From cf51e034ae93514d336507938fc4a8a51794fda0 Mon Sep 17 00:00:00 2001 From: MyronFanQiu <49134743+MyronFanQiu@users.noreply.github.com> Date: Tue, 16 Jun 2020 16:41:57 +0800 Subject: [PATCH] Release 20200616 (#2788) * config change for event grid * regen sdk * config change for azure_mgmt_hdinsight * regen azure_mgmt_hdinsight * config change for azure_mgmt_data_factory * regen sdk * config change for azure_mgmt_cosmosdb * regen sdk * config change for azure_mgmt_security * regen sdk --- azure_sdk/lib/azure_sdk/version.rb | 2 +- .../modules/datafactory_profile_module.rb | 1410 ++++--- .../modules/eventgrid_profile_module.rb | 622 +-- .../modules/hdinsight_profile_module.rb | 534 ++- .../latest/modules/security_profile_module.rb | 624 +-- config/GEMS_TO_RELEASE | 6 +- config/GEM_VERSIONS | 12 +- config/config.json | 49 +- config/profiles.json | 10 +- .../azure_mgmt_cosmosdb/cosmos_db.rb | 2 +- .../cosmos_dbmanagement_client.rb | 2 +- .../cosmos_dbmanagement_client.rb | 2 +- .../generated/azure_mgmt_cosmosdb.rb | 190 + .../cassandra_resources.rb | 1628 ++++++++ .../azure_mgmt_cosmosdb/collection.rb | 374 ++ .../collection_partition.rb | 269 ++ .../collection_partition_region.rb | 156 + .../azure_mgmt_cosmosdb/collection_region.rb | 156 + .../cosmos_dbmanagement_client.rb | 210 + .../generated/azure_mgmt_cosmosdb/database.rb | 362 ++ .../database_account_region.rb | 148 + .../azure_mgmt_cosmosdb/database_accounts.rb | 2184 ++++++++++ .../azure_mgmt_cosmosdb/gremlin_resources.rb | 1623 ++++++++ .../models/armproxy_resource.rb | 73 + .../models/armresource_properties.rb | 102 + .../models/auto_upgrade_policy_resource.rb | 48 + .../azure_mgmt_cosmosdb/models/capability.rb | 48 + ...andra_keyspace_create_update_parameters.rb | 112 + ...sandra_keyspace_get_properties_resource.rb | 85 + .../models/cassandra_keyspace_get_results.rb | 98 + .../models/cassandra_keyspace_list_result.rb | 58 + .../models/cassandra_keyspace_resource.rb | 46 + .../models/cassandra_partition_key.rb | 46 + .../models/cassandra_schema.rb | 95 + ...assandra_table_create_update_parameters.rb | 112 + ...cassandra_table_get_properties_resource.rb | 108 + .../models/cassandra_table_get_results.rb | 98 + .../models/cassandra_table_list_result.rb | 58 + .../models/cassandra_table_resource.rb | 69 + .../azure_mgmt_cosmosdb/models/cluster_key.rb | 58 + .../azure_mgmt_cosmosdb/models/column.rb | 57 + .../models/composite_path.rb | 60 + .../models/composite_path_sort_order.rb | 16 + .../models/conflict_resolution_mode.rb | 16 + .../models/conflict_resolution_policy.rb | 73 + .../models/connector_offer.rb | 15 + .../models/consistency_policy.rb | 86 + .../models/container_partition_key.rb | 85 + .../models/create_update_options.rb | 68 + .../azure_mgmt_cosmosdb/models/data_type.rb | 20 + .../database_account_connection_string.rb | 59 + ...tabase_account_create_update_parameters.rb | 290 ++ .../models/database_account_get_results.rb | 382 ++ .../models/database_account_kind.rb | 17 + ..._account_list_connection_strings_result.rb | 57 + .../database_account_list_keys_result.rb | 77 + ...base_account_list_read_only_keys_result.rb | 59 + .../models/database_account_offer_type.rb | 15 + ...abase_account_regenerate_key_parameters.rb | 47 + .../database_account_update_parameters.rb | 241 ++ .../models/database_accounts_list_result.rb | 58 + .../models/default_consistency_level.rb | 19 + .../models/error_response.rb | 57 + .../models/excluded_path.rb | 48 + .../models/extended_resource_properties.rb | 74 + .../models/failover_policies.rb | 55 + .../models/failover_policy.rb | 79 + ...emlin_database_create_update_parameters.rb | 112 + ...remlin_database_get_properties_resource.rb | 85 + .../models/gremlin_database_get_results.rb | 98 + .../models/gremlin_database_list_result.rb | 58 + .../models/gremlin_database_resource.rb | 46 + .../gremlin_graph_create_update_parameters.rb | 112 + .../gremlin_graph_get_properties_resource.rb | 150 + .../models/gremlin_graph_get_results.rb | 98 + .../models/gremlin_graph_list_result.rb | 58 + .../models/gremlin_graph_resource.rb | 111 + .../models/included_path.rb | 67 + .../azure_mgmt_cosmosdb/models/index_kind.rb | 17 + .../azure_mgmt_cosmosdb/models/indexes.rb | 73 + .../models/indexing_mode.rb | 17 + .../models/indexing_policy.rb | 147 + .../azure_mgmt_cosmosdb/models/key_kind.rb | 18 + .../azure_mgmt_cosmosdb/models/location.rb | 114 + .../azure_mgmt_cosmosdb/models/metric.rb | 120 + .../models/metric_availability.rb | 60 + .../models/metric_definition.rb | 109 + .../models/metric_definitions_list_result.rb | 57 + .../models/metric_list_result.rb | 56 + .../azure_mgmt_cosmosdb/models/metric_name.rb | 59 + .../models/metric_value.rb | 107 + ...o_dbcollection_create_update_parameters.rb | 112 + ...go_dbcollection_get_properties_resource.rb | 125 + .../models/mongo_dbcollection_get_results.rb | 98 + .../models/mongo_dbcollection_list_result.rb | 58 + .../models/mongo_dbcollection_resource.rb | 86 + ...ngo_dbdatabase_create_update_parameters.rb | 112 + ...ongo_dbdatabase_get_properties_resource.rb | 85 + .../models/mongo_dbdatabase_get_results.rb | 98 + .../models/mongo_dbdatabase_list_result.rb | 58 + .../models/mongo_dbdatabase_resource.rb | 46 + .../azure_mgmt_cosmosdb/models/mongo_index.rb | 60 + .../models/mongo_index_keys.rb | 55 + .../models/mongo_index_options.rb | 57 + .../models/notebook_workspace.rb | 87 + ...tebook_workspace_connection_info_result.rb | 60 + ...book_workspace_create_update_parameters.rb | 62 + .../models/notebook_workspace_list_result.rb | 56 + .../azure_mgmt_cosmosdb/models/operation.rb | 58 + .../models/operation_display.rb | 80 + .../models/operation_list_result.rb | 101 + .../models/partition_kind.rb | 16 + .../models/partition_metric.rb | 124 + .../models/partition_metric_list_result.rb | 57 + .../models/partition_usage.rb | 105 + .../models/partition_usages_result.rb | 57 + .../models/percentile_metric.rb | 120 + .../models/percentile_metric_list_result.rb | 57 + .../models/percentile_metric_value.rb | 173 + .../models/primary_aggregation_type.rb | 20 + ...rovisioned_throughput_settings_resource.rb | 73 + .../models/region_for_online_offline.rb | 47 + .../models/spatial_spec.rb | 67 + .../models/spatial_type.rb | 18 + .../sql_container_create_update_parameters.rb | 111 + .../sql_container_get_properties_resource.rb | 150 + .../models/sql_container_get_results.rb | 98 + .../models/sql_container_list_result.rb | 58 + .../models/sql_container_resource.rb | 111 + .../sql_database_create_update_parameters.rb | 112 + .../sql_database_get_properties_resource.rb | 109 + .../models/sql_database_get_results.rb | 98 + .../models/sql_database_list_result.rb | 58 + .../models/sql_database_resource.rb | 46 + ...ored_procedure_create_update_parameters.rb | 112 + ...tored_procedure_get_properties_resource.rb | 96 + .../sql_stored_procedure_get_results.rb | 98 + .../sql_stored_procedure_list_result.rb | 58 + .../models/sql_stored_procedure_resource.rb | 57 + .../sql_trigger_create_update_parameters.rb | 111 + .../sql_trigger_get_properties_resource.rb | 121 + .../models/sql_trigger_get_results.rb | 98 + .../models/sql_trigger_list_result.rb | 58 + .../models/sql_trigger_resource.rb | 82 + ...fined_function_create_update_parameters.rb | 113 + ...efined_function_get_properties_resource.rb | 97 + .../sql_user_defined_function_get_results.rb | 98 + .../sql_user_defined_function_list_result.rb | 58 + .../sql_user_defined_function_resource.rb | 57 + .../models/table_create_update_parameters.rb | 111 + .../models/table_get_properties_resource.rb | 85 + .../models/table_get_results.rb | 98 + .../models/table_list_result.rb | 57 + .../models/table_resource.rb | 46 + .../models/throughput_policy_resource.rb | 59 + ...ughput_settings_get_properties_resource.rb | 125 + .../models/throughput_settings_get_results.rb | 98 + .../models/throughput_settings_resource.rb | 87 + .../throughput_settings_update_parameters.rb | 99 + .../models/trigger_operation.rb | 19 + .../models/trigger_type.rb | 16 + .../azure_mgmt_cosmosdb/models/unique_key.rb | 56 + .../models/unique_key_policy.rb | 58 + .../azure_mgmt_cosmosdb/models/unit_type.rb | 21 + .../azure_mgmt_cosmosdb/models/usage.rb | 97 + .../models/usages_result.rb | 57 + .../models/virtual_network_rule.rb | 59 + .../azure_mgmt_cosmosdb/module_definition.rb | 9 + .../azure_mgmt_cosmosdb/mongo_dbresources.rb | 1634 ++++++++ .../notebook_workspaces.rb | 907 ++++ .../azure_mgmt_cosmosdb/operations.rb | 219 + .../partition_key_range_id.rb | 156 + .../partition_key_range_id_region.rb | 163 + .../azure_mgmt_cosmosdb/percentile.rb | 141 + .../percentile_source_target.rb | 158 + .../azure_mgmt_cosmosdb/percentile_target.rb | 148 + .../azure_mgmt_cosmosdb/sql_resources.rb | 3289 +++++++++++++++ .../azure_mgmt_cosmosdb/table_resources.rb | 804 ++++ .../generated/azure_mgmt_cosmosdb.rb | 208 + .../cassandra_resources.rb | 1700 ++++++++ .../azure_mgmt_cosmosdb/collection.rb | 389 ++ .../collection_partition.rb | 279 ++ .../collection_partition_region.rb | 161 + .../azure_mgmt_cosmosdb/collection_region.rb | 161 + .../cosmos_dbmanagement_client.rb | 203 + .../generated/azure_mgmt_cosmosdb/database.rb | 377 ++ .../database_account_region.rb | 153 + .../azure_mgmt_cosmosdb/database_accounts.rb | 2281 +++++++++++ .../azure_mgmt_cosmosdb/gremlin_resources.rb | 1695 ++++++++ .../models/armproxy_resource.rb | 73 + .../models/armresource_properties.rb | 102 + .../models/auto_upgrade_policy_resource.rb | 48 + .../models/azure_entity_resource.rb | 75 + .../azure_mgmt_cosmosdb/models/capability.rb | 48 + ...andra_keyspace_create_update_parameters.rb | 112 + ...ssandra_keyspace_get_properties_options.rb | 44 + ...sandra_keyspace_get_properties_resource.rb | 85 + .../models/cassandra_keyspace_get_results.rb | 110 + .../models/cassandra_keyspace_list_result.rb | 58 + .../models/cassandra_keyspace_resource.rb | 46 + .../models/cassandra_partition_key.rb | 46 + .../models/cassandra_schema.rb | 95 + ...assandra_table_create_update_parameters.rb | 112 + .../cassandra_table_get_properties_options.rb | 44 + ...cassandra_table_get_properties_resource.rb | 108 + .../models/cassandra_table_get_results.rb | 110 + .../models/cassandra_table_list_result.rb | 58 + .../models/cassandra_table_resource.rb | 69 + .../azure_mgmt_cosmosdb/models/cluster_key.rb | 58 + .../azure_mgmt_cosmosdb/models/column.rb | 57 + .../models/composite_path.rb | 60 + .../models/composite_path_sort_order.rb | 16 + .../models/conflict_resolution_mode.rb | 16 + .../models/conflict_resolution_policy.rb | 73 + .../models/connector_offer.rb | 15 + .../models/consistency_policy.rb | 86 + .../models/container_partition_key.rb | 85 + .../models/create_update_options.rb | 68 + .../azure_mgmt_cosmosdb/models/data_type.rb | 20 + .../database_account_connection_string.rb | 59 + ...tabase_account_create_update_parameters.rb | 302 ++ .../models/database_account_get_results.rb | 416 ++ .../models/database_account_kind.rb | 17 + ..._account_list_connection_strings_result.rb | 57 + .../database_account_list_keys_result.rb | 77 + ...base_account_list_read_only_keys_result.rb | 59 + .../models/database_account_offer_type.rb | 15 + ...abase_account_regenerate_key_parameters.rb | 47 + .../database_account_update_parameters.rb | 253 ++ .../models/database_accounts_list_result.rb | 58 + .../models/default_consistency_level.rb | 19 + .../models/error_response.rb | 57 + .../models/excluded_path.rb | 48 + .../models/extended_resource_properties.rb | 74 + .../models/failover_policies.rb | 55 + .../models/failover_policy.rb | 79 + ...emlin_database_create_update_parameters.rb | 112 + ...gremlin_database_get_properties_options.rb | 44 + ...remlin_database_get_properties_resource.rb | 85 + .../models/gremlin_database_get_results.rb | 110 + .../models/gremlin_database_list_result.rb | 58 + .../models/gremlin_database_resource.rb | 46 + .../gremlin_graph_create_update_parameters.rb | 112 + .../gremlin_graph_get_properties_options.rb | 44 + .../gremlin_graph_get_properties_resource.rb | 150 + .../models/gremlin_graph_get_results.rb | 110 + .../models/gremlin_graph_list_result.rb | 58 + .../models/gremlin_graph_resource.rb | 111 + .../models/included_path.rb | 67 + .../azure_mgmt_cosmosdb/models/index_kind.rb | 17 + .../azure_mgmt_cosmosdb/models/indexes.rb | 73 + .../models/indexing_mode.rb | 17 + .../models/indexing_policy.rb | 147 + .../azure_mgmt_cosmosdb/models/key_kind.rb | 18 + .../azure_mgmt_cosmosdb/models/location.rb | 114 + .../azure_mgmt_cosmosdb/models/metric.rb | 120 + .../models/metric_availability.rb | 60 + .../models/metric_definition.rb | 109 + .../models/metric_definitions_list_result.rb | 57 + .../models/metric_list_result.rb | 56 + .../azure_mgmt_cosmosdb/models/metric_name.rb | 59 + .../models/metric_value.rb | 107 + ...o_dbcollection_create_update_parameters.rb | 112 + ...ngo_dbcollection_get_properties_options.rb | 44 + ...go_dbcollection_get_properties_resource.rb | 125 + .../models/mongo_dbcollection_get_results.rb | 110 + .../models/mongo_dbcollection_list_result.rb | 58 + .../models/mongo_dbcollection_resource.rb | 86 + ...ngo_dbdatabase_create_update_parameters.rb | 112 + ...mongo_dbdatabase_get_properties_options.rb | 44 + ...ongo_dbdatabase_get_properties_resource.rb | 85 + .../models/mongo_dbdatabase_get_results.rb | 110 + .../models/mongo_dbdatabase_list_result.rb | 58 + .../models/mongo_dbdatabase_resource.rb | 46 + .../azure_mgmt_cosmosdb/models/mongo_index.rb | 60 + .../models/mongo_index_keys.rb | 55 + .../models/mongo_index_options.rb | 57 + .../models/notebook_workspace.rb | 87 + ...tebook_workspace_connection_info_result.rb | 60 + ...book_workspace_create_update_parameters.rb | 62 + .../models/notebook_workspace_list_result.rb | 56 + .../azure_mgmt_cosmosdb/models/operation.rb | 58 + .../models/operation_display.rb | 80 + .../models/operation_list_result.rb | 101 + .../models/options_resource.rb | 47 + .../models/partition_kind.rb | 16 + .../models/partition_metric.rb | 124 + .../models/partition_metric_list_result.rb | 57 + .../models/partition_usage.rb | 105 + .../models/partition_usages_result.rb | 57 + .../models/percentile_metric.rb | 120 + .../models/percentile_metric_list_result.rb | 57 + .../models/percentile_metric_value.rb | 173 + .../models/primary_aggregation_type.rb | 20 + .../models/private_endpoint_connection.rb | 88 + .../models/private_endpoint_property.rb | 46 + ..._link_service_connection_state_property.rb | 60 + ...rovisioned_throughput_settings_resource.rb | 73 + .../models/proxy_resource.rb | 63 + .../models/public_network_access.rb | 16 + .../models/region_for_online_offline.rb | 47 + .../azure_mgmt_cosmosdb/models/resource.rb | 83 + .../models/spatial_spec.rb | 67 + .../models/spatial_type.rb | 18 + .../sql_container_create_update_parameters.rb | 111 + .../sql_container_get_properties_options.rb | 44 + .../sql_container_get_properties_resource.rb | 150 + .../models/sql_container_get_results.rb | 110 + .../models/sql_container_list_result.rb | 58 + .../models/sql_container_resource.rb | 111 + .../sql_database_create_update_parameters.rb | 112 + .../sql_database_get_properties_options.rb | 44 + .../sql_database_get_properties_resource.rb | 109 + .../models/sql_database_get_results.rb | 110 + .../models/sql_database_list_result.rb | 58 + .../models/sql_database_resource.rb | 46 + ...ored_procedure_create_update_parameters.rb | 112 + ...tored_procedure_get_properties_resource.rb | 96 + .../sql_stored_procedure_get_results.rb | 98 + .../sql_stored_procedure_list_result.rb | 58 + .../models/sql_stored_procedure_resource.rb | 57 + .../sql_trigger_create_update_parameters.rb | 111 + .../sql_trigger_get_properties_resource.rb | 121 + .../models/sql_trigger_get_results.rb | 98 + .../models/sql_trigger_list_result.rb | 58 + .../models/sql_trigger_resource.rb | 82 + ...fined_function_create_update_parameters.rb | 113 + ...efined_function_get_properties_resource.rb | 97 + .../sql_user_defined_function_get_results.rb | 98 + .../sql_user_defined_function_list_result.rb | 58 + .../sql_user_defined_function_resource.rb | 57 + .../models/table_create_update_parameters.rb | 111 + .../models/table_get_properties_options.rb | 44 + .../models/table_get_properties_resource.rb | 85 + .../models/table_get_results.rb | 110 + .../models/table_list_result.rb | 57 + .../models/table_resource.rb | 46 + .../models/throughput_policy_resource.rb | 59 + ...ughput_settings_get_properties_resource.rb | 125 + .../models/throughput_settings_get_results.rb | 98 + .../models/throughput_settings_resource.rb | 87 + .../throughput_settings_update_parameters.rb | 99 + .../models/tracked_resource.rb | 92 + .../models/trigger_operation.rb | 19 + .../models/trigger_type.rb | 16 + .../azure_mgmt_cosmosdb/models/unique_key.rb | 56 + .../models/unique_key_policy.rb | 58 + .../azure_mgmt_cosmosdb/models/unit_type.rb | 21 + .../azure_mgmt_cosmosdb/models/usage.rb | 97 + .../models/usages_result.rb | 57 + .../models/virtual_network_rule.rb | 59 + .../azure_mgmt_cosmosdb/module_definition.rb | 9 + .../azure_mgmt_cosmosdb/mongo_dbresources.rb | 1706 ++++++++ .../notebook_workspaces.rb | 907 ++++ .../azure_mgmt_cosmosdb/operations.rb | 220 + .../partition_key_range_id.rb | 161 + .../partition_key_range_id_region.rb | 168 + .../azure_mgmt_cosmosdb/percentile.rb | 146 + .../percentile_source_target.rb | 163 + .../azure_mgmt_cosmosdb/percentile_target.rb | 153 + .../azure_mgmt_cosmosdb/sql_resources.rb | 3433 ++++++++++++++++ .../azure_mgmt_cosmosdb/table_resources.rb | 840 ++++ .../generated/azure_mgmt_cosmosdb.rb | 212 + .../cassandra_resources.rb | 1700 ++++++++ .../azure_mgmt_cosmosdb/collection.rb | 389 ++ .../collection_partition.rb | 279 ++ .../collection_partition_region.rb | 161 + .../azure_mgmt_cosmosdb/collection_region.rb | 161 + .../cosmos_dbmanagement_client.rb | 203 + .../generated/azure_mgmt_cosmosdb/database.rb | 377 ++ .../database_account_region.rb | 153 + .../azure_mgmt_cosmosdb/database_accounts.rb | 2281 +++++++++++ .../azure_mgmt_cosmosdb/gremlin_resources.rb | 1695 ++++++++ .../models/api_properties.rb | 48 + .../models/armproxy_resource.rb | 73 + .../models/armresource_properties.rb | 102 + .../models/auto_upgrade_policy_resource.rb | 48 + .../models/autoscale_settings.rb | 48 + .../models/autoscale_settings_resource.rb | 73 + .../models/azure_entity_resource.rb | 75 + .../azure_mgmt_cosmosdb/models/capability.rb | 48 + ...andra_keyspace_create_update_parameters.rb | 112 + ...ssandra_keyspace_get_properties_options.rb | 53 + ...sandra_keyspace_get_properties_resource.rb | 85 + .../models/cassandra_keyspace_get_results.rb | 110 + .../models/cassandra_keyspace_list_result.rb | 58 + .../models/cassandra_keyspace_resource.rb | 46 + .../models/cassandra_partition_key.rb | 46 + .../models/cassandra_schema.rb | 95 + ...assandra_table_create_update_parameters.rb | 112 + .../cassandra_table_get_properties_options.rb | 53 + ...cassandra_table_get_properties_resource.rb | 119 + .../models/cassandra_table_get_results.rb | 110 + .../models/cassandra_table_list_result.rb | 58 + .../models/cassandra_table_resource.rb | 80 + .../azure_mgmt_cosmosdb/models/cluster_key.rb | 58 + .../azure_mgmt_cosmosdb/models/column.rb | 57 + .../models/composite_path.rb | 60 + .../models/composite_path_sort_order.rb | 16 + .../models/conflict_resolution_mode.rb | 16 + .../models/conflict_resolution_policy.rb | 73 + .../models/connector_offer.rb | 15 + .../models/consistency_policy.rb | 86 + .../models/container_partition_key.rb | 85 + .../models/create_update_options.rb | 61 + .../azure_mgmt_cosmosdb/models/data_type.rb | 20 + .../database_account_connection_string.rb | 59 + ...tabase_account_create_update_parameters.rb | 342 ++ .../models/database_account_get_results.rb | 455 ++ .../models/database_account_kind.rb | 17 + ..._account_list_connection_strings_result.rb | 57 + .../database_account_list_keys_result.rb | 77 + ...base_account_list_read_only_keys_result.rb | 59 + .../models/database_account_offer_type.rb | 15 + ...abase_account_regenerate_key_parameters.rb | 47 + .../database_account_update_parameters.rb | 293 ++ .../models/database_accounts_list_result.rb | 58 + .../models/default_consistency_level.rb | 19 + .../models/error_response.rb | 57 + .../models/excluded_path.rb | 48 + .../models/extended_resource_properties.rb | 74 + .../models/failover_policies.rb | 55 + .../models/failover_policy.rb | 79 + ...emlin_database_create_update_parameters.rb | 112 + ...gremlin_database_get_properties_options.rb | 53 + ...remlin_database_get_properties_resource.rb | 85 + .../models/gremlin_database_get_results.rb | 110 + .../models/gremlin_database_list_result.rb | 58 + .../models/gremlin_database_resource.rb | 46 + .../gremlin_graph_create_update_parameters.rb | 112 + .../gremlin_graph_get_properties_options.rb | 53 + .../gremlin_graph_get_properties_resource.rb | 150 + .../models/gremlin_graph_get_results.rb | 110 + .../models/gremlin_graph_list_result.rb | 58 + .../models/gremlin_graph_resource.rb | 111 + .../models/included_path.rb | 67 + .../azure_mgmt_cosmosdb/models/index_kind.rb | 17 + .../azure_mgmt_cosmosdb/models/indexes.rb | 73 + .../models/indexing_mode.rb | 17 + .../models/indexing_policy.rb | 147 + .../models/ip_address_or_range.rb | 51 + .../azure_mgmt_cosmosdb/models/key_kind.rb | 18 + .../azure_mgmt_cosmosdb/models/location.rb | 114 + .../azure_mgmt_cosmosdb/models/metric.rb | 120 + .../models/metric_availability.rb | 60 + .../models/metric_definition.rb | 109 + .../models/metric_definitions_list_result.rb | 57 + .../models/metric_list_result.rb | 56 + .../azure_mgmt_cosmosdb/models/metric_name.rb | 59 + .../models/metric_value.rb | 107 + ...o_dbcollection_create_update_parameters.rb | 112 + ...ngo_dbcollection_get_properties_options.rb | 53 + ...go_dbcollection_get_properties_resource.rb | 136 + .../models/mongo_dbcollection_get_results.rb | 110 + .../models/mongo_dbcollection_list_result.rb | 58 + .../models/mongo_dbcollection_resource.rb | 97 + ...ngo_dbdatabase_create_update_parameters.rb | 112 + ...mongo_dbdatabase_get_properties_options.rb | 53 + ...ongo_dbdatabase_get_properties_resource.rb | 85 + .../models/mongo_dbdatabase_get_results.rb | 110 + .../models/mongo_dbdatabase_list_result.rb | 58 + .../models/mongo_dbdatabase_resource.rb | 46 + .../azure_mgmt_cosmosdb/models/mongo_index.rb | 60 + .../models/mongo_index_keys.rb | 55 + .../models/mongo_index_options.rb | 57 + .../models/notebook_workspace.rb | 87 + ...tebook_workspace_connection_info_result.rb | 60 + ...book_workspace_create_update_parameters.rb | 62 + .../models/notebook_workspace_list_result.rb | 56 + .../azure_mgmt_cosmosdb/models/operation.rb | 58 + .../models/operation_display.rb | 80 + .../models/operation_list_result.rb | 101 + .../models/options_resource.rb | 60 + .../models/partition_kind.rb | 16 + .../models/partition_metric.rb | 124 + .../models/partition_metric_list_result.rb | 57 + .../models/partition_usage.rb | 105 + .../models/partition_usages_result.rb | 57 + .../models/percentile_metric.rb | 120 + .../models/percentile_metric_list_result.rb | 57 + .../models/percentile_metric_value.rb | 173 + .../models/primary_aggregation_type.rb | 20 + .../models/private_endpoint_connection.rb | 88 + .../models/private_endpoint_property.rb | 46 + ..._link_service_connection_state_property.rb | 60 + .../models/proxy_resource.rb | 63 + .../models/public_network_access.rb | 16 + .../models/region_for_online_offline.rb | 47 + .../azure_mgmt_cosmosdb/models/resource.rb | 83 + .../models/server_version.rb | 16 + .../models/spatial_spec.rb | 67 + .../models/spatial_type.rb | 18 + .../sql_container_create_update_parameters.rb | 111 + .../sql_container_get_properties_options.rb | 53 + .../sql_container_get_properties_resource.rb | 150 + .../models/sql_container_get_results.rb | 110 + .../models/sql_container_list_result.rb | 58 + .../models/sql_container_resource.rb | 111 + .../sql_database_create_update_parameters.rb | 112 + .../sql_database_get_properties_options.rb | 53 + .../sql_database_get_properties_resource.rb | 109 + .../models/sql_database_get_results.rb | 110 + .../models/sql_database_list_result.rb | 58 + .../models/sql_database_resource.rb | 46 + ...ored_procedure_create_update_parameters.rb | 112 + ...tored_procedure_get_properties_resource.rb | 96 + .../sql_stored_procedure_get_results.rb | 98 + .../sql_stored_procedure_list_result.rb | 58 + .../models/sql_stored_procedure_resource.rb | 57 + .../sql_trigger_create_update_parameters.rb | 111 + .../sql_trigger_get_properties_resource.rb | 121 + .../models/sql_trigger_get_results.rb | 98 + .../models/sql_trigger_list_result.rb | 58 + .../models/sql_trigger_resource.rb | 82 + ...fined_function_create_update_parameters.rb | 113 + ...efined_function_get_properties_resource.rb | 97 + .../sql_user_defined_function_get_results.rb | 98 + .../sql_user_defined_function_list_result.rb | 58 + .../sql_user_defined_function_resource.rb | 57 + .../models/table_create_update_parameters.rb | 111 + .../models/table_get_properties_options.rb | 53 + .../models/table_get_properties_resource.rb | 85 + .../models/table_get_results.rb | 110 + .../models/table_list_result.rb | 57 + .../models/table_resource.rb | 46 + .../models/throughput_policy_resource.rb | 59 + ...ughput_settings_get_properties_resource.rb | 124 + .../models/throughput_settings_get_results.rb | 98 + .../models/throughput_settings_resource.rb | 86 + .../throughput_settings_update_parameters.rb | 99 + .../models/tracked_resource.rb | 92 + .../models/trigger_operation.rb | 19 + .../models/trigger_type.rb | 16 + .../azure_mgmt_cosmosdb/models/unique_key.rb | 56 + .../models/unique_key_policy.rb | 58 + .../azure_mgmt_cosmosdb/models/unit_type.rb | 21 + .../azure_mgmt_cosmosdb/models/usage.rb | 97 + .../models/usages_result.rb | 57 + .../models/virtual_network_rule.rb | 59 + .../azure_mgmt_cosmosdb/module_definition.rb | 9 + .../azure_mgmt_cosmosdb/mongo_dbresources.rb | 1706 ++++++++ .../notebook_workspaces.rb | 907 ++++ .../azure_mgmt_cosmosdb/operations.rb | 220 + .../partition_key_range_id.rb | 161 + .../partition_key_range_id_region.rb | 168 + .../azure_mgmt_cosmosdb/percentile.rb | 146 + .../percentile_source_target.rb | 163 + .../azure_mgmt_cosmosdb/percentile_target.rb | 153 + .../azure_mgmt_cosmosdb/sql_resources.rb | 3433 ++++++++++++++++ .../azure_mgmt_cosmosdb/table_resources.rb | 840 ++++ .../lib/azure_mgmt_cosmosdb.rb | 7 +- management/azure_mgmt_cosmosdb/lib/version.rb | 2 +- .../generated/azure_mgmt_data_factory.rb | 153 +- .../data_factory_management_client.rb | 2 +- .../models/blob_events_trigger.rb | 12 + .../models/execute_ssispackage_activity.rb | 12 + .../models/ssis_package_location_type.rb | 16 + .../models/ssisaccess_credential.rb | 71 + .../models/ssislog_location.rb | 86 + .../models/ssispackage_location.rb | 50 + .../generated/azure_mgmt_data_factory.rb | 357 +- .../data_factory_management_client.rb | 2 +- .../models/amazon_s3read_settings.rb | 25 + .../models/azure_blob_fsread_settings.rb | 25 + .../azure_blob_storage_read_settings.rb | 25 + .../azure_data_lake_store_read_settings.rb | 53 + .../azure_file_storage_linked_service.rb | 66 +- .../azure_file_storage_read_settings.rb | 37 + .../models/azure_sql_source.rb | 26 + .../models/binary_read_settings.rb | 79 + .../models/binary_source.rb | 12 + .../models/compression_read_settings.rb | 65 + .../models/copy_sink.rb | 1 + .../models/copy_source.rb | 4 + .../models/data_flow_sink.rb | 24 + .../models/data_flow_source.rb | 24 + .../azure_mgmt_data_factory/models/dataset.rb | 4 + .../models/delete_activity.rb | 14 + .../models/delimited_text_read_settings.rb | 14 + .../models/dynamics_axsource.rb | 14 + .../models/excel_dataset.rb | 220 + .../models/excel_source.rb | 125 + .../models/export_settings.rb | 65 + .../azure_mgmt_data_factory/models/factory.rb | 21 + .../models/file_server_read_settings.rb | 38 + .../models/format_read_settings.rb | 3 + .../models/ftp_read_settings.rb | 36 + .../models/get_metadata_activity.rb | 28 + .../models/global_parameter_specification.rb | 58 + .../models/global_parameter_type.rb | 20 + .../google_cloud_storage_read_settings.rb | 25 + .../models/hdfs_read_settings.rb | 12 + .../models/http_read_settings.rb | 23 + .../models/import_settings.rb | 65 + .../integration_runtime_ssis_properties.rb | 21 + .../models/json_read_settings.rb | 79 + .../models/json_source.rb | 12 + .../models/linked_service.rb | 2 + .../models/odata_source.rb | 14 + .../models/package_store.rb | 58 + .../models/sap_cloud_for_customer_sink.rb | 14 + .../models/sap_cloud_for_customer_source.rb | 14 + .../models/sap_ecc_source.rb | 14 + .../models/sap_hana_linked_service.rb | 2 +- .../models/sftp_read_settings.rb | 36 + .../share_point_online_list_linked_service.rb | 184 + ...hare_point_online_list_resource_dataset.rb | 153 + .../models/share_point_online_list_source.rb | 116 + .../models/snowflake_dataset.rb | 165 + .../models/snowflake_export_copy_command.rb | 109 + .../models/snowflake_import_copy_command.rb | 109 + .../models/snowflake_linked_service.rb | 152 + .../models/snowflake_sink.rb | 129 + .../models/snowflake_source.rb | 113 + .../models/sql_dwsource.rb | 26 + .../models/sql_misource.rb | 26 + .../models/sql_partition_option.rb | 17 + .../models/sql_partition_settings.rb | 79 + .../models/sql_server_source.rb | 26 + .../models/sql_source.rb | 26 + .../models/ssis_package_location_type.rb | 1 + .../models/ssispackage_location.rb | 16 +- .../models/wait_activity.rb | 4 +- .../models/xml_dataset.rb | 198 + .../models/xml_read_settings.rb | 107 + .../models/xml_source.rb | 137 + .../models/zip_deflate_read_settings.rb | 77 + .../modules/datafactory_profile_module.rb | 1410 ++++--- .../azure_mgmt_data_factory/lib/version.rb | 2 +- .../event_grid_management_client.rb | 2 +- .../event_grid_management_client.rb | 2 +- .../event_grid_management_client.rb | 2 +- .../event_grid_management_client.rb | 2 +- .../event_grid_management_client.rb | 2 +- .../event_grid_management_client.rb | 2 +- .../event_grid_management_client.rb | 2 +- .../event_grid_management_client.rb | 2 +- .../event_grid_management_client.rb | 2 +- .../event_grid_management_client.rb | 2 +- .../generated/azure_mgmt_event_grid.rb | 108 + .../azure_mgmt_event_grid/domain_topics.rb | 699 ++++ .../azure_mgmt_event_grid/domains.rb | 1328 ++++++ .../event_grid_management_client.rb | 161 + .../event_subscriptions.rb | 3648 +++++++++++++++++ .../models/advanced_filter.rb | 74 + ...function_event_subscription_destination.rb | 86 + .../models/bool_equals_advanced_filter.rb | 69 + .../models/connection_state.rb | 69 + .../models/dead_letter_destination.rb | 50 + .../azure_mgmt_event_grid/models/domain.rb | 212 + .../models/domain_provisioning_state.rb | 20 + .../models/domain_regenerate_key_request.rb | 46 + .../models/domain_shared_access_keys.rb | 57 + .../models/domain_topic.rb | 75 + .../models/domain_topic_provisioning_state.rb | 20 + .../models/domain_topics_list_result.rb | 98 + .../models/domain_update_parameters.rb | 91 + .../models/domains_list_result.rb | 98 + .../models/event_delivery_schema.rb | 17 + ...vent_hub_event_subscription_destination.rb | 62 + .../models/event_subscription.rb | 189 + .../models/event_subscription_destination.rb | 52 + .../models/event_subscription_filter.rb | 120 + .../models/event_subscription_full_url.rb | 47 + .../event_subscription_provisioning_state.rb | 21 + .../event_subscription_update_parameters.rb | 137 + .../models/event_subscriptions_list_result.rb | 98 + .../models/event_type.rb | 106 + .../models/event_types_list_result.rb | 55 + ...nnection_event_subscription_destination.rb | 64 + .../models/inbound_ip_rule.rb | 59 + .../models/input_schema.rb | 17 + .../models/input_schema_mapping.rb | 49 + .../models/ip_action_type.rb | 15 + .../models/json_field.rb | 50 + .../models/json_field_with_default.rb | 67 + .../models/json_input_schema_mapping.rb | 130 + .../number_greater_than_advanced_filter.rb | 69 + ..._greater_than_or_equals_advanced_filter.rb | 69 + .../models/number_in_advanced_filter.rb | 77 + .../number_less_than_advanced_filter.rb | 69 + ...ber_less_than_or_equals_advanced_filter.rb | 69 + .../models/number_not_in_advanced_filter.rb | 77 + .../azure_mgmt_event_grid/models/operation.rb | 80 + .../models/operation_info.rb | 79 + .../models/operations_list_result.rb} | 18 +- .../models/persisted_connection_status.rb | 18 + .../models/private_endpoint.rb | 46 + .../models/private_endpoint_connection.rb | 121 + ...private_endpoint_connection_list_result.rb | 100 + .../models/private_link_resource.rb | 128 + .../private_link_resources_list_result.rb | 99 + .../models/public_network_access.rb | 16 + .../azure_mgmt_event_grid/models/resource.rb | 80 + .../models/resource_provisioning_state.rb | 20 + .../models/resource_region_type.rb | 16 + .../models/retry_policy.rb | 57 + ...us_queue_event_subscription_destination.rb | 63 + ...us_topic_event_subscription_destination.rb | 64 + .../storage_blob_dead_letter_destination.rb | 74 + ...ge_queue_event_subscription_destination.rb | 75 + .../string_begins_with_advanced_filter.rb | 77 + .../models/string_contains_advanced_filter.rb | 77 + .../string_ends_with_advanced_filter.rb | 77 + .../models/string_in_advanced_filter.rb | 77 + .../models/string_not_in_advanced_filter.rb | 77 + .../azure_mgmt_event_grid/models/topic.rb | 213 + .../models/topic_provisioning_state.rb | 20 + .../models/topic_regenerate_key_request.rb | 46 + .../models/topic_shared_access_keys.rb | 57 + .../models/topic_type_info.rb | 150 + .../models/topic_type_provisioning_state.rb | 20 + .../models/topic_types_list_result.rb | 55 + .../models/topic_update_parameters.rb | 91 + .../models/topics_list_result.rb | 98 + .../models/tracked_resource.rb | 92 + ...web_hook_event_subscription_destination.rb | 122 + .../module_definition.rb | 9 + .../azure_mgmt_event_grid/operations.rb | 118 + .../private_endpoint_connections.rb | 791 ++++ .../private_link_resources.rb | 423 ++ .../azure_mgmt_event_grid/topic_types.rb | 305 ++ .../generated/azure_mgmt_event_grid/topics.rb | 1439 +++++++ .../lib/azure_mgmt_event_grid.rb | 1 + .../modules/eventgrid_profile_module.rb | 622 +-- .../azure_mgmt_event_grid/lib/version.rb | 2 +- .../hdinsight_management_client.rb | 2 +- .../generated/azure_mgmt_hdinsight.rb | 141 +- .../hdinsight_management_client.rb | 2 +- .../azure_mgmt_hdinsight/virtual_machines.rb | 20 +- .../modules/hdinsight_profile_module.rb | 534 ++- .../azure_mgmt_hdinsight/lib/version.rb | 2 +- .../azure_mgmt_security/security_center.rb | 2 +- .../azure_mgmt_security/security_center.rb | 2 +- .../azure_mgmt_security/security_center.rb | 2 +- .../azure_mgmt_security/security_center.rb | 2 +- .../azure_mgmt_security/security_center.rb | 2 +- .../azure_mgmt_security/security_center.rb | 2 +- .../azure_mgmt_security/security_center.rb | 2 +- .../generated/azure_mgmt_security.rb | 48 + .../models/asc_location.rb | 73 + .../models/azure_resource_link.rb | 47 + .../models/control_type.rb | 16 + .../azure_mgmt_security/models/etag.rb | 48 + .../models/expand_controls_enum.rb | 15 + .../azure_mgmt_security/models/kind.rb | 46 + .../azure_mgmt_security/models/location.rb | 47 + .../azure_mgmt_security/models/resource.rb | 80 + .../secure_score_control_definition_item.rb | 141 + .../secure_score_control_definition_list.rb | 101 + .../secure_score_control_definition_source.rb | 47 + .../models/secure_score_control_details.rb | 153 + .../models/secure_score_control_list.rb | 101 + .../models/secure_score_control_score.rb | 69 + .../models/secure_score_item.rb | 104 + .../models/secure_scores_list.rb | 101 + .../azure_mgmt_security/models/tags.rb | 55 + .../models/tracked_resource.rb | 126 + .../azure_mgmt_security/module_definition.rb | 9 + .../secure_score_control_definitions.rb | 423 ++ .../secure_score_controls.rb | 444 ++ .../azure_mgmt_security/secure_scores.rb | 326 ++ .../azure_mgmt_security/security_center.rb | 139 + .../generated/azure_mgmt_security.rb | 121 + .../adaptive_application_controls.rb | 394 ++ .../adaptive_network_hardenings.rb | 539 +++ .../allowed_connections.rb | 535 +++ .../azure_mgmt_security/assessments.rb | 555 +++ .../assessments_metadata.rb | 799 ++++ .../discovered_security_solutions.rb | 532 +++ .../external_security_solutions.rb | 525 +++ .../jit_network_access_policies.rb | 1295 ++++++ .../models/aad_connectivity_state.rb | 17 + .../models/aad_connectivity_state1.rb | 48 + .../models/aad_external_security_solution.rb | 99 + .../models/aad_solution_properties.rb | 83 + .../models/adaptive_network_hardening.rb | 116 + ...ptive_network_hardening_enforce_request.rb | 77 + .../adaptive_network_hardenings_list.rb | 99 + .../models/allowed_connections_list.rb | 100 + .../models/allowed_connections_resource.rb | 118 + .../models/app_whitelisting_group.rb | 207 + .../models/app_whitelisting_groups.rb | 56 + .../models/app_whitelisting_issue_summary.rb | 61 + .../models/asc_location.rb | 73 + .../models/assessment_links.rb | 47 + .../models/assessment_status.rb | 71 + .../models/assessment_status_code.rb | 17 + .../models/assessment_type.rb | 18 + .../models/ata_external_security_solution.rb | 98 + .../models/ata_solution_properties.rb | 87 + .../models/azure_resource_details.rb | 62 + .../azure_mgmt_security/models/category.rb | 19 + .../models/cef_external_security_solution.rb | 98 + .../models/cef_solution_properties.rb | 109 + .../models/connectable_resource.rb | 91 + .../models/connected_resource.rb | 71 + .../models/connected_workspace.rb | 47 + .../models/connection_type.rb | 16 + .../azure_mgmt_security/models/direction.rb | 16 + .../models/discovered_security_solution.rb | 129 + .../discovered_security_solution_list.rb | 99 + .../effective_network_security_groups.rb | 66 + .../azure_mgmt_security/models/etag.rb | 48 + .../azure_mgmt_security/models/expand_enum.rb | 16 + .../models/external_security_solution.rb | 98 + .../models/external_security_solution_kind.rb | 17 + .../external_security_solution_kind1.rb | 47 + .../models/external_security_solution_list.rb | 101 + .../external_security_solution_properties.rb | 88 + .../models/implementation_effort.rb | 17 + .../jit_network_access_policies_list.rb | 99 + .../models/jit_network_access_policy.rb | 149 + ...jit_network_access_policy_initiate_port.rb | 70 + ..._network_access_policy_initiate_request.rb | 68 + ..._access_policy_initiate_virtual_machine.rb | 70 + ...t_network_access_policy_virtual_machine.rb | 81 + .../models/jit_network_access_port_rule.rb | 103 + .../models/jit_network_access_request.rb | 89 + .../models/jit_network_access_request_port.rb | 128 + ..._network_access_request_virtual_machine.rb | 69 + .../azure_mgmt_security/models/kind.rb | 46 + .../azure_mgmt_security/models/location.rb | 47 + .../models/on_premise_resource_details.rb | 95 + .../models/path_recommendation.rb | 156 + .../models/protection_mode.rb | 80 + .../azure_mgmt_security/models/protocol.rb | 17 + .../models/publisher_info.rb | 84 + .../azure_mgmt_security/models/resource.rb | 80 + .../models/resource_details.rb | 47 + .../azure_mgmt_security/models/rule.rb | 111 + .../models/security_assessment.rb | 156 + .../models/security_assessment_list.rb | 101 + .../models/security_assessment_metadata.rb | 221 + .../security_assessment_metadata_list.rb | 100 + ...curity_assessment_metadata_partner_data.rb | 70 + ...security_assessment_metadata_properties.rb | 194 + .../security_assessment_partner_data.rb | 57 + .../models/security_family.rb | 18 + .../models/server_vulnerability_assessment.rb | 76 + .../server_vulnerability_assessments_list.rb | 55 + .../azure_mgmt_security/models/severity.rb | 17 + .../azure_mgmt_security/models/status.rb | 16 + .../models/status_reason.rb | 17 + .../azure_mgmt_security/models/tags.rb | 55 + .../azure_mgmt_security/models/threats.rb | 22 + .../models/topology_list.rb | 100 + .../models/topology_resource.rb | 118 + .../models/topology_single_resource.rb | 154 + .../models/topology_single_resource_child.rb | 49 + .../models/topology_single_resource_parent.rb | 49 + .../models/tracked_resource.rb | 126 + .../models/transport_protocol.rb | 16 + .../azure_mgmt_security/models/user_impact.rb | 17 + .../models/user_recommendation.rb | 58 + .../models/vm_recommendation.rb | 81 + .../azure_mgmt_security/module_definition.rb | 9 + .../azure_mgmt_security/security_center.rb | 172 + ...ver_vulnerability_assessment_operations.rb | 462 +++ .../generated/azure_mgmt_security/topology.rb | 530 +++ .../lib/azure_mgmt_security.rb | 2 + .../latest/modules/security_profile_module.rb | 624 +-- management/azure_mgmt_security/lib/version.rb | 2 +- 863 files changed, 120198 insertions(+), 3537 deletions(-) create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/cassandra_resources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_partition.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_partition_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database_account_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database_accounts.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/gremlin_resources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/capability.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cluster_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/column.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/composite_path.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/connector_offer.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/create_update_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/data_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/error_response.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/excluded_path.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/failover_policies.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/failover_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/included_path.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/index_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexes.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/key_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/location.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_availability.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_definition.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_name.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_value.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation_display.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_metric.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_usage.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/provisioned_throughput_settings_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/spatial_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/trigger_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unique_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unit_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/usage.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/usages_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/module_definition.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/operations.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile_source_target.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile_target.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/table_resources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_partition.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database_account_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database_accounts.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/capability.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/column.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/data_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/error_response.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/included_path.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexes.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/location.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/provisioned_throughput_settings_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/public_network_access.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/spatial_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/usage.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/module_definition.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/operations.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile_target.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/sql_resources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/table_resources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_partition.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database_account_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database_accounts.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/api_properties.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/capability.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/column.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/data_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/error_response.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/included_path.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexes.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/location.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/public_network_access.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/server_version.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/spatial_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/usage.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/module_definition.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/operations.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile_target.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/sql_resources.rb create mode 100644 management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/table_resources.rb create mode 100644 management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssis_package_location_type.rb create mode 100644 management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssisaccess_credential.rb create mode 100644 management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssislog_location.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/binary_read_settings.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/compression_read_settings.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/excel_dataset.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/excel_source.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/export_settings.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/global_parameter_specification.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/global_parameter_type.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/import_settings.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/json_read_settings.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/package_store.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_linked_service.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_resource_dataset.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_source.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_dataset.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_export_copy_command.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_import_copy_command.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_linked_service.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_sink.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_source.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_partition_option.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_partition_settings.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_dataset.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_read_settings.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_source.rb create mode 100644 management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/zip_deflate_read_settings.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/domain_topics.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/domains.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_subscriptions.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/connection_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domains_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_type.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_types_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/inbound_ip_rule.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/input_schema.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/ip_action_type.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_field.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_field_with_default.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operation.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operation_info.rb rename management/{azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/host_info_list_result.rb => azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operations_list_result.rb} (69%) create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/persisted_connection_status.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resource.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resources_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/public_network_access.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource_provisioning_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource_region_type.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/retry_policy.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_info.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topics_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/tracked_resource.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/module_definition.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/operations.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/private_endpoint_connections.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/private_link_resources.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/topic_types.rb create mode 100644 management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/topics.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/asc_location.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/azure_resource_link.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/control_type.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/etag.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/expand_controls_enum.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/kind.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/location.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/resource.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_item.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_source.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_details.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_score.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_item.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_scores_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/tags.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/tracked_resource.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/module_definition.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_score_control_definitions.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_score_controls.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_scores.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/security_center.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/adaptive_application_controls.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/adaptive_network_hardenings.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/allowed_connections.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/assessments.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/assessments_metadata.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/discovered_security_solutions.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/external_security_solutions.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/jit_network_access_policies.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state1.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_external_security_solution.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_solution_properties.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening_enforce_request.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardenings_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/allowed_connections_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/allowed_connections_resource.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_group.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_groups.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_issue_summary.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/asc_location.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_links.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_status.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_status_code.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_type.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/ata_external_security_solution.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/ata_solution_properties.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/azure_resource_details.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/category.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/cef_external_security_solution.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/cef_solution_properties.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connectable_resource.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connected_resource.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connected_workspace.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connection_type.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/direction.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/effective_network_security_groups.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/etag.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/expand_enum.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind1.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_properties.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/implementation_effort.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policies_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_port.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_request.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_virtual_machine.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_virtual_machine.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_port_rule.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_port.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_virtual_machine.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/kind.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/location.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/on_premise_resource_details.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/path_recommendation.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/protection_mode.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/protocol.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/publisher_info.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/resource.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/resource_details.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/rule.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_partner_data.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_properties.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_partner_data.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_family.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessment.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessments_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/severity.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/status.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/status_reason.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/tags.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/threats.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_list.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_resource.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_child.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_parent.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/tracked_resource.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/transport_protocol.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/user_impact.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/user_recommendation.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/vm_recommendation.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/module_definition.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/security_center.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/server_vulnerability_assessment_operations.rb create mode 100644 management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/topology.rb diff --git a/azure_sdk/lib/azure_sdk/version.rb b/azure_sdk/lib/azure_sdk/version.rb index 45e63c935..ebdbae8e0 100644 --- a/azure_sdk/lib/azure_sdk/version.rb +++ b/azure_sdk/lib/azure_sdk/version.rb @@ -3,5 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. module Azure - VERSION = '0.58.1' + VERSION = '0.59.0' end diff --git a/azure_sdk/lib/latest/modules/datafactory_profile_module.rb b/azure_sdk/lib/latest/modules/datafactory_profile_module.rb index 2f2154bc5..bace6d298 100644 --- a/azure_sdk/lib/latest/modules/datafactory_profile_module.rb +++ b/azure_sdk/lib/latest/modules/datafactory_profile_module.rb @@ -24,166 +24,172 @@ module Azure::Profiles::Latest DataFlowDebugSession = Azure::DataFactory::Mgmt::V2018_06_01::DataFlowDebugSession module Models - DataFlowDebugCommandResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandResponse - DataFlowDebugSessionInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugSessionInfo - SubResource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResource - QueryDataFlowDebugSessionsResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::QueryDataFlowDebugSessionsResponse - Expression = Azure::DataFactory::Mgmt::V2018_06_01::Models::Expression - GetDataFactoryOperationStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::GetDataFactoryOperationStatusResponse - LinkedServiceReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceReference - DataFlowReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowReference - SecretBase = Azure::DataFactory::Mgmt::V2018_06_01::Models::SecretBase - DataFlowDebugPackage = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackage - FactoryRepoConfiguration = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoConfiguration - AddDataFlowToDebugSessionResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::AddDataFlowToDebugSessionResponse - FactoryListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryListResponse - DeleteDataFlowDebugSessionRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::DeleteDataFlowDebugSessionRequest - DataFlowSourceSetting = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSourceSetting DataFlowStagingInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowStagingInfo - IntegrationRuntimeReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeReference - DWCopyCommandDefaultValue = Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandDefaultValue - IntegrationRuntimeStatus = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatus - DataFlowDebugPackageDebugSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackageDebugSettings - IntegrationRuntimeStatusListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusListResponse - UpdateIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeRequest - ScheduleTriggerRecurrence = Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTriggerRecurrence - LinkedIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeRequest - IntegrationRuntime = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntime - ParameterSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::ParameterSpecification - DWCopyCommandSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandSettings - SSISExecutionCredential = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionCredential - DataFlowDebugCommandPayload = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandPayload - DatasetFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetFolder - DataFlowDebugCommandRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandRequest - SSISChildPackage = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISChildPackage Resource = Azure::DataFactory::Mgmt::V2018_06_01::Models::Resource - ActivityDependency = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityDependency - SubResourceDebugResource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResourceDebugResource - Activity = Azure::DataFactory::Mgmt::V2018_06_01::Models::Activity - VariableSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::VariableSpecification - PipelineFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineFolder - RecurrenceSchedule = Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceSchedule - PipelineListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineListResponse - RecurrenceScheduleOccurrence = Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceScheduleOccurrence - SSISPackageLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPackageLocation - FactoryIdentity = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryIdentity - TriggerListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerListResponse - SSISAccessCredential = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISAccessCredential - WebActivityAuthentication = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivityAuthentication SkipErrorFile = Azure::DataFactory::Mgmt::V2018_06_01::Models::SkipErrorFile - Transformation = Azure::DataFactory::Mgmt::V2018_06_01::Models::Transformation - FactoryRepoUpdate = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoUpdate - CustomActivityReferenceObject = Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomActivityReferenceObject - GitHubAccessTokenResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenResponse - LogStorageSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::LogStorageSettings - AccessPolicyResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::AccessPolicyResponse - CopySource = Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySource - TriggerPipelineReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerPipelineReference - FormatReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatReadSettings - DatasetReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetReference - StoreReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreReadSettings - ExecuteDataFlowActivityTypePropertiesCompute = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivityTypePropertiesCompute - AdditionalColumns = Azure::DataFactory::Mgmt::V2018_06_01::Models::AdditionalColumns - RunQueryFilter = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryFilter - MongoDbCursorMethodsProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::MongoDbCursorMethodsProperties - RunFilterParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunFilterParameters - SapHanaPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapHanaPartitionSettings - PipelineRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRun - SapTablePartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTablePartitionSettings - ActivityRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRun - StoredProcedureParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameter - TriggerRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRun - ScriptAction = Azure::DataFactory::Mgmt::V2018_06_01::Models::ScriptAction - OperationDisplay = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationDisplay - TeradataPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionSettings - OperationMetricAvailability = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricAvailability - OraclePartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::OraclePartitionSettings - OperationMetricSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricSpecification - NetezzaPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::NetezzaPartitionSettings - Operation = Azure::DataFactory::Mgmt::V2018_06_01::Models::Operation - RedshiftUnloadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::RedshiftUnloadSettings - GetSsisObjectMetadataRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::GetSsisObjectMetadataRequest - DistcpSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DistcpSettings - ExposureControlRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlRequest - SSISLogLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISLogLocation - DataFlowFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowFolder - AzureMLWebServiceFile = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLWebServiceFile - ActivityPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityPolicy - SSISPropertyOverride = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPropertyOverride - CreateDataFlowDebugSessionRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionRequest - DatasetStorageFormat = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetStorageFormat - IntegrationRuntimeListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeListResponse - IntegrationRuntimeConnectionInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeConnectionInfo - IntegrationRuntimeStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusResponse - IntegrationRuntimeRegenerateKeyParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeRegenerateKeyParameters - CreateLinkedIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateLinkedIntegrationRuntimeRequest - IntegrationRuntimeAuthKeys = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeAuthKeys - LinkedServiceListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceListResponse - IntegrationRuntimeMonitoringData = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeMonitoringData - DatasetListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetListResponse - DatasetCompression = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetCompression - WebLinkedServiceTypeProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebLinkedServiceTypeProperties - IntegrationRuntimeNodeMonitoringData = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeMonitoringData - TriggerQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerQueryResponse - SsisObjectMetadataListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataListResponse - TriggerSubscriptionOperationStatus = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerSubscriptionOperationStatus - SsisObjectMetadata = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadata - GitHubAccessTokenRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenRequest - SsisEnvironmentReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisEnvironmentReference - PipelineReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineReference - SsisParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisParameter - StagingSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StagingSettings - SsisVariable = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisVariable - RunQueryOrderBy = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryOrderBy - IntegrationRuntimeNodeIpAddress = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeIpAddress - PipelineRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunsQueryResponse - IntegrationRuntimeComputeProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeComputeProperties - TriggerRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRunsQueryResponse - IntegrationRuntimeDataFlowProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataFlowProperties - OperationMetricDimension = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricDimension - IntegrationRuntimeVNetProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeVNetProperties - OperationListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationListResponse - IntegrationRuntimeSsisProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisProperties - ExposureControlResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlResponse - IntegrationRuntimeSsisCatalogInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisCatalogInfo - DataFlowListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowListResponse - DatasetLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetLocation - SSISExecutionParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionParameter - IntegrationRuntimeCustomSetupScriptProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeCustomSetupScriptProperties - LinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedService - IntegrationRuntimeDataProxyProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataProxyProperties - UserProperty = Azure::DataFactory::Mgmt::V2018_06_01::Models::UserProperty - EntityReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::EntityReference - CreateRunResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateRunResponse - CustomSetupBase = Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomSetupBase - UserAccessPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::UserAccessPolicy - LinkedIntegrationRuntimeType = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeType - TriggerFilterParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerFilterParameters - ManagedIntegrationRuntimeNode = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeNode - ActivityRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRunsQueryResponse - ManagedIntegrationRuntimeError = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeError - OperationServiceSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationServiceSpecification - ManagedIntegrationRuntimeOperationResult = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeOperationResult - DataFlow = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlow - SelfHostedIntegrationRuntimeNode = Azure::DataFactory::Mgmt::V2018_06_01::Models::SelfHostedIntegrationRuntimeNode - UpdateIntegrationRuntimeNodeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeNodeRequest - LinkedIntegrationRuntime = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntime - Trigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::Trigger - TriggerReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerReference - FactoryUpdateParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryUpdateParameters - SwitchCase = Azure::DataFactory::Mgmt::V2018_06_01::Models::SwitchCase - OperationLogSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationLogSpecification + SubResourceDebugResource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResourceDebugResource + DataFlowDebugPackageDebugSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackageDebugSettings CopySink = Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySink + DataFlowListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowListResponse + AzureMLWebServiceFile = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLWebServiceFile + CreateDataFlowDebugSessionRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionRequest + FactoryIdentity = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryIdentity CreateDataFlowDebugSessionResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionResponse - DependencyReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DependencyReference - RedirectIncompatibleRowSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::RedirectIncompatibleRowSettings - RetryPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::RetryPolicy - SsisObjectMetadataStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataStatusResponse - FormatWriteSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatWriteSettings - PipelineRunInvokedBy = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunInvokedBy - StoreWriteSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreWriteSettings + GlobalParameterSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::GlobalParameterSpecification + DataFlowSourceSetting = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSourceSetting + FactoryListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryListResponse + SubResource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResource + StagingSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StagingSettings + Expression = Azure::DataFactory::Mgmt::V2018_06_01::Models::Expression + IntegrationRuntimeReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeReference + SwitchCase = Azure::DataFactory::Mgmt::V2018_06_01::Models::SwitchCase + IntegrationRuntimeStatus = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatus + DataFlowDebugPackage = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackage + IntegrationRuntimeStatusListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusListResponse + AddDataFlowToDebugSessionResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::AddDataFlowToDebugSessionResponse + UpdateIntegrationRuntimeNodeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeNodeRequest + DeleteDataFlowDebugSessionRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::DeleteDataFlowDebugSessionRequest + CreateLinkedIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateLinkedIntegrationRuntimeRequest + DataFlowDebugCommandPayload = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandPayload + LinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedService + DataFlowDebugCommandRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandRequest + LinkedServiceListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceListResponse + DataFlowDebugCommandResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandResponse Dataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::Dataset + DataFlowDebugSessionInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugSessionInfo + DatasetListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetListResponse + QueryDataFlowDebugSessionsResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::QueryDataFlowDebugSessionsResponse + UserProperty = Azure::DataFactory::Mgmt::V2018_06_01::Models::UserProperty + GetDataFactoryOperationStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::GetDataFactoryOperationStatusResponse + VariableSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::VariableSpecification + DataFlowReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowReference + DWCopyCommandSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandSettings + SSISPropertyOverride = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPropertyOverride + Trigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::Trigger + FormatReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatReadSettings + TriggerQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerQueryResponse + Transformation = Azure::DataFactory::Mgmt::V2018_06_01::Models::Transformation + CreateRunResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateRunResponse + DistcpSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DistcpSettings + TriggerSubscriptionOperationStatus = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerSubscriptionOperationStatus + SSISLogLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISLogLocation + FormatWriteSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatWriteSettings + SSISAccessCredential = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISAccessCredential + GitHubAccessTokenRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenRequest + CustomActivityReferenceObject = Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomActivityReferenceObject + UserAccessPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::UserAccessPolicy + LogStorageSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::LogStorageSettings + PipelineReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineReference + CopySource = Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySource + FactoryUpdateParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryUpdateParameters + SapHanaPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapHanaPartitionSettings + ExecuteDataFlowActivityTypePropertiesCompute = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivityTypePropertiesCompute + SapTablePartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTablePartitionSettings + TriggerFilterParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerFilterParameters + StoredProcedureParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameter + RunQueryOrderBy = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryOrderBy + SqlPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlPartitionSettings + PipelineRunInvokedBy = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunInvokedBy + TeradataPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionSettings + PipelineRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunsQueryResponse + NetezzaPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::NetezzaPartitionSettings + ActivityRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRunsQueryResponse + ScriptAction = Azure::DataFactory::Mgmt::V2018_06_01::Models::ScriptAction + TriggerRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRunsQueryResponse + StoreReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreReadSettings + OperationLogSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationLogSpecification + RedshiftUnloadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::RedshiftUnloadSettings + OperationMetricDimension = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricDimension + WebActivityAuthentication = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivityAuthentication + OperationServiceSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationServiceSpecification + OraclePartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::OraclePartitionSettings + OperationListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationListResponse + MongoDbCursorMethodsProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::MongoDbCursorMethodsProperties + SsisObjectMetadataStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataStatusResponse + ExportSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExportSettings + ExposureControlResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlResponse + AdditionalColumns = Azure::DataFactory::Mgmt::V2018_06_01::Models::AdditionalColumns + DataFlow = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlow + SSISExecutionParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionParameter + SecretBase = Azure::DataFactory::Mgmt::V2018_06_01::Models::SecretBase + SSISExecutionCredential = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionCredential + RedirectIncompatibleRowSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::RedirectIncompatibleRowSettings + SSISChildPackage = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISChildPackage + IntegrationRuntimeListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeListResponse + CompressionReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::CompressionReadSettings + IntegrationRuntimeStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusResponse + SSISPackageLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPackageLocation + LinkedIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeRequest + IntegrationRuntimeConnectionInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeConnectionInfo + DWCopyCommandDefaultValue = Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandDefaultValue + IntegrationRuntimeRegenerateKeyParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeRegenerateKeyParameters + WebLinkedServiceTypeProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebLinkedServiceTypeProperties + IntegrationRuntimeAuthKeys = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeAuthKeys + Activity = Azure::DataFactory::Mgmt::V2018_06_01::Models::Activity + IntegrationRuntimeMonitoringData = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeMonitoringData + PipelineListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineListResponse + IntegrationRuntimeNodeMonitoringData = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeMonitoringData + TriggerListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerListResponse + SsisObjectMetadataListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataListResponse + StoreWriteSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreWriteSettings + SsisObjectMetadata = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadata + GitHubAccessTokenResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenResponse + DatasetStorageFormat = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetStorageFormat + TriggerPipelineReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerPipelineReference + SsisEnvironmentReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisEnvironmentReference + ActivityPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityPolicy + SsisParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisParameter + RunFilterParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunFilterParameters + SsisVariable = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisVariable + ActivityRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRun + DatasetLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetLocation + OperationDisplay = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationDisplay + IntegrationRuntimeNodeIpAddress = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeIpAddress + OperationMetricSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricSpecification + DatasetCompression = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetCompression + GetSsisObjectMetadataRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::GetSsisObjectMetadataRequest + IntegrationRuntimeComputeProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeComputeProperties + DataFlowFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowFolder + IntegrationRuntimeDataFlowProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataFlowProperties + FactoryRepoConfiguration = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoConfiguration + IntegrationRuntimeVNetProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeVNetProperties + ImportSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::ImportSettings + IntegrationRuntimeSsisProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisProperties + ParameterSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::ParameterSpecification + IntegrationRuntimeSsisCatalogInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisCatalogInfo + ActivityDependency = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityDependency + IntegrationRuntimeCustomSetupScriptProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeCustomSetupScriptProperties PolybaseSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::PolybaseSettings + IntegrationRuntimeDataProxyProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataProxyProperties + FactoryRepoUpdate = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoUpdate + CustomSetupBase = Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomSetupBase + DatasetReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetReference + PackageStore = Azure::DataFactory::Mgmt::V2018_06_01::Models::PackageStore + PipelineRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRun + EntityReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::EntityReference + OperationMetricAvailability = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricAvailability + LinkedIntegrationRuntimeType = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeType + ExposureControlRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlRequest + TriggerReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerReference + IntegrationRuntime = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntime + ManagedIntegrationRuntimeNode = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeNode + DatasetFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetFolder + ManagedIntegrationRuntimeError = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeError + DependencyReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DependencyReference + RunQueryFilter = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryFilter + RetryPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::RetryPolicy + Operation = Azure::DataFactory::Mgmt::V2018_06_01::Models::Operation + ManagedIntegrationRuntimeOperationResult = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeOperationResult + UpdateIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeRequest + SelfHostedIntegrationRuntimeNode = Azure::DataFactory::Mgmt::V2018_06_01::Models::SelfHostedIntegrationRuntimeNode + AccessPolicyResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::AccessPolicyResponse + LinkedIntegrationRuntime = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntime + LinkedServiceReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceReference + RecurrenceScheduleOccurrence = Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceScheduleOccurrence + TriggerRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRun + RecurrenceSchedule = Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceSchedule + PipelineFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineFolder + ScheduleTriggerRecurrence = Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTriggerRecurrence SecureString = Azure::DataFactory::Mgmt::V2018_06_01::Models::SecureString AzureKeyVaultSecretReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureKeyVaultSecretReference Factory = Azure::DataFactory::Mgmt::V2018_06_01::Models::Factory @@ -202,6 +208,8 @@ module Azure::Profiles::Latest DataFlowSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSink DataFlowSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSource MappingDataFlow = Azure::DataFactory::Mgmt::V2018_06_01::Models::MappingDataFlow + SharePointOnlineListLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListLinkedService + SnowflakeLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeLinkedService AzureFunctionLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFunctionLinkedService AzureDataExplorerLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataExplorerLinkedService SapTableLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTableLinkedService @@ -299,6 +307,8 @@ module Azure::Profiles::Latest AzureTableStorageLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureTableStorageLinkedService AzureBlobStorageLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageLinkedService AzureStorageLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureStorageLinkedService + SharePointOnlineListResourceDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListResourceDataset + SnowflakeDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeDataset GoogleAdWordsObjectDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleAdWordsObjectDataset AzureDataExplorerTableDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataExplorerTableDataset OracleServiceCloudObjectDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::OracleServiceCloudObjectDataset @@ -401,9 +411,11 @@ module Azure::Profiles::Latest AzureBlobStorageLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageLocation BinaryDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::BinaryDataset OrcDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::OrcDataset + XmlDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlDataset JsonDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonDataset DelimitedTextDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextDataset ParquetDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::ParquetDataset + ExcelDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExcelDataset AvroDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::AvroDataset AmazonS3Dataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::AmazonS3Dataset ChainingTrigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::ChainingTrigger @@ -416,7 +428,6 @@ module Azure::Profiles::Latest BlobEventsTrigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::BlobEventsTrigger BlobTrigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::BlobTrigger ScheduleTrigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTrigger - ExecutionActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecutionActivity ExecuteDataFlowActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivity AzureFunctionActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFunctionActivity DatabricksSparkPythonActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatabricksSparkPythonActivity @@ -426,8 +437,27 @@ module Azure::Profiles::Latest AzureMLExecutePipelineActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLExecutePipelineActivity AzureMLUpdateResourceActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLUpdateResourceActivity AzureMLBatchExecutionActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLBatchExecutionActivity + ZipDeflateReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::ZipDeflateReadSettings + BinaryReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::BinaryReadSettings + XmlReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlReadSettings + JsonReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonReadSettings + DelimitedTextReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextReadSettings + HdfsReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::HdfsReadSettings + HttpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpReadSettings + SftpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SftpReadSettings + FtpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FtpReadSettings + GoogleCloudStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleCloudStorageReadSettings + AzureFileStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFileStorageReadSettings + FileServerReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FileServerReadSettings + AmazonS3ReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AmazonS3ReadSettings + AzureDataLakeStoreReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreReadSettings + AzureBlobFSReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSReadSettings + AzureBlobStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageReadSettings GetMetadataActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::GetMetadataActivity WebActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivity + SharePointOnlineListSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListSource + SnowflakeExportCopyCommand = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeExportCopyCommand + SnowflakeSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeSource HttpSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpSource AzureBlobFSSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSSource AzureDataLakeStoreSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreSource @@ -509,23 +539,13 @@ module Azure::Profiles::Latest Db2Source = Azure::DataFactory::Mgmt::V2018_06_01::Models::Db2Source InformixSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::InformixSource AzureTableSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureTableSource - HdfsReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::HdfsReadSettings - HttpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpReadSettings - SftpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SftpReadSettings - FtpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FtpReadSettings - GoogleCloudStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleCloudStorageReadSettings - AzureFileStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFileStorageReadSettings - FileServerReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FileServerReadSettings - AmazonS3ReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AmazonS3ReadSettings - AzureDataLakeStoreReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreReadSettings - AzureBlobFSReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSReadSettings - AzureBlobStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageReadSettings BinarySource = Azure::DataFactory::Mgmt::V2018_06_01::Models::BinarySource OrcSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::OrcSource + XmlSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlSource JsonSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonSource - DelimitedTextReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextReadSettings DelimitedTextSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextSource ParquetSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::ParquetSource + ExcelSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExcelSource AvroSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::AvroSource LookupActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::LookupActivity AzureDataExplorerCommandActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataExplorerCommandActivity @@ -552,6 +572,8 @@ module Azure::Profiles::Latest AzureBlobFSSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSSink AzureDataLakeStoreSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreSink OracleSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::OracleSink + SnowflakeImportCopyCommand = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeImportCopyCommand + SnowflakeSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeSink SqlDWSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlDWSink SqlMISink = Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlMISink AzureSqlSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureSqlSink @@ -580,6 +602,7 @@ module Azure::Profiles::Latest OrcSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::OrcSink JsonSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonSink DelimitedTextSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextSink + ExecutionActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecutionActivity CopyActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::CopyActivity ControlActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::ControlActivity WebHookActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebHookActivity @@ -606,6 +629,7 @@ module Azure::Profiles::Latest SsisPackage = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisPackage SsisProject = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisProject SsisFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisFolder + GlobalParameterType = Azure::DataFactory::Mgmt::V2018_06_01::Models::GlobalParameterType IntegrationRuntimeState = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeState IntegrationRuntimeAutoUpdate = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeAutoUpdate ParameterType = Azure::DataFactory::Mgmt::V2018_06_01::Models::ParameterType @@ -660,6 +684,7 @@ module Azure::Profiles::Latest NetezzaPartitionOption = Azure::DataFactory::Mgmt::V2018_06_01::Models::NetezzaPartitionOption CassandraSourceReadConsistencyLevels = Azure::DataFactory::Mgmt::V2018_06_01::Models::CassandraSourceReadConsistencyLevels TeradataPartitionOption = Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionOption + SqlPartitionOption = Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlPartitionOption StoredProcedureParameterType = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameterType SapTablePartitionOption = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTablePartitionOption SapHanaPartitionOption = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapHanaPartitionOption @@ -728,486 +753,504 @@ module Azure::Profiles::Latest end class ModelClasses - def data_flow_debug_command_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandResponse - end - def data_flow_debug_session_info - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugSessionInfo - end - def sub_resource - Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResource - end - def query_data_flow_debug_sessions_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::QueryDataFlowDebugSessionsResponse - end - def expression - Azure::DataFactory::Mgmt::V2018_06_01::Models::Expression - end - def get_data_factory_operation_status_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::GetDataFactoryOperationStatusResponse - end - def linked_service_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceReference - end - def data_flow_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowReference - end - def secret_base - Azure::DataFactory::Mgmt::V2018_06_01::Models::SecretBase - end - def data_flow_debug_package - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackage - end - def factory_repo_configuration - Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoConfiguration - end - def add_data_flow_to_debug_session_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::AddDataFlowToDebugSessionResponse - end - def factory_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryListResponse - end - def delete_data_flow_debug_session_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::DeleteDataFlowDebugSessionRequest - end - def data_flow_source_setting - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSourceSetting - end def data_flow_staging_info Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowStagingInfo end - def integration_runtime_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeReference - end - def dwcopy_command_default_value - Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandDefaultValue - end - def integration_runtime_status - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatus - end - def data_flow_debug_package_debug_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackageDebugSettings - end - def integration_runtime_status_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusListResponse - end - def update_integration_runtime_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeRequest - end - def schedule_trigger_recurrence - Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTriggerRecurrence - end - def linked_integration_runtime_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeRequest - end - def integration_runtime - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntime - end - def parameter_specification - Azure::DataFactory::Mgmt::V2018_06_01::Models::ParameterSpecification - end - def dwcopy_command_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandSettings - end - def ssisexecution_credential - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionCredential - end - def data_flow_debug_command_payload - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandPayload - end - def dataset_folder - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetFolder - end - def data_flow_debug_command_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandRequest - end - def ssischild_package - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISChildPackage - end def resource Azure::DataFactory::Mgmt::V2018_06_01::Models::Resource end - def activity_dependency - Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityDependency + def skip_error_file + Azure::DataFactory::Mgmt::V2018_06_01::Models::SkipErrorFile end def sub_resource_debug_resource Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResourceDebugResource end - def activity - Azure::DataFactory::Mgmt::V2018_06_01::Models::Activity - end - def variable_specification - Azure::DataFactory::Mgmt::V2018_06_01::Models::VariableSpecification - end - def pipeline_folder - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineFolder - end - def recurrence_schedule - Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceSchedule - end - def pipeline_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineListResponse - end - def recurrence_schedule_occurrence - Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceScheduleOccurrence - end - def ssispackage_location - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPackageLocation - end - def factory_identity - Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryIdentity - end - def trigger_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerListResponse - end - def ssisaccess_credential - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISAccessCredential - end - def web_activity_authentication - Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivityAuthentication - end - def skip_error_file - Azure::DataFactory::Mgmt::V2018_06_01::Models::SkipErrorFile - end - def transformation - Azure::DataFactory::Mgmt::V2018_06_01::Models::Transformation - end - def factory_repo_update - Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoUpdate - end - def custom_activity_reference_object - Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomActivityReferenceObject - end - def git_hub_access_token_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenResponse - end - def log_storage_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::LogStorageSettings - end - def access_policy_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::AccessPolicyResponse - end - def copy_source - Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySource - end - def trigger_pipeline_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerPipelineReference - end - def format_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatReadSettings - end - def dataset_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetReference - end - def store_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreReadSettings - end - def execute_data_flow_activity_type_properties_compute - Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivityTypePropertiesCompute - end - def additional_columns - Azure::DataFactory::Mgmt::V2018_06_01::Models::AdditionalColumns - end - def run_query_filter - Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryFilter - end - def mongo_db_cursor_methods_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::MongoDbCursorMethodsProperties - end - def run_filter_parameters - Azure::DataFactory::Mgmt::V2018_06_01::Models::RunFilterParameters - end - def sap_hana_partition_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::SapHanaPartitionSettings - end - def pipeline_run - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRun - end - def sap_table_partition_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTablePartitionSettings - end - def activity_run - Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRun - end - def stored_procedure_parameter - Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameter - end - def trigger_run - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRun - end - def script_action - Azure::DataFactory::Mgmt::V2018_06_01::Models::ScriptAction - end - def operation_display - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationDisplay - end - def teradata_partition_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionSettings - end - def operation_metric_availability - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricAvailability - end - def oracle_partition_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::OraclePartitionSettings - end - def operation_metric_specification - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricSpecification - end - def netezza_partition_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::NetezzaPartitionSettings - end - def operation - Azure::DataFactory::Mgmt::V2018_06_01::Models::Operation - end - def redshift_unload_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::RedshiftUnloadSettings - end - def get_ssis_object_metadata_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::GetSsisObjectMetadataRequest - end - def distcp_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::DistcpSettings - end - def exposure_control_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlRequest - end - def ssislog_location - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISLogLocation - end - def data_flow_folder - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowFolder - end - def azure_mlweb_service_file - Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLWebServiceFile - end - def activity_policy - Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityPolicy - end - def ssisproperty_override - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPropertyOverride - end - def create_data_flow_debug_session_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionRequest - end - def dataset_storage_format - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetStorageFormat - end - def integration_runtime_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeListResponse - end - def integration_runtime_connection_info - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeConnectionInfo - end - def integration_runtime_status_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusResponse - end - def integration_runtime_regenerate_key_parameters - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeRegenerateKeyParameters - end - def create_linked_integration_runtime_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateLinkedIntegrationRuntimeRequest - end - def integration_runtime_auth_keys - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeAuthKeys - end - def linked_service_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceListResponse - end - def integration_runtime_monitoring_data - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeMonitoringData - end - def dataset_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetListResponse - end - def dataset_compression - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetCompression - end - def web_linked_service_type_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::WebLinkedServiceTypeProperties - end - def integration_runtime_node_monitoring_data - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeMonitoringData - end - def trigger_query_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerQueryResponse - end - def ssis_object_metadata_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataListResponse - end - def trigger_subscription_operation_status - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerSubscriptionOperationStatus - end - def ssis_object_metadata - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadata - end - def git_hub_access_token_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenRequest - end - def ssis_environment_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisEnvironmentReference - end - def pipeline_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineReference - end - def ssis_parameter - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisParameter - end - def staging_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::StagingSettings - end - def ssis_variable - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisVariable - end - def run_query_order_by - Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryOrderBy - end - def integration_runtime_node_ip_address - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeIpAddress - end - def pipeline_runs_query_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunsQueryResponse - end - def integration_runtime_compute_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeComputeProperties - end - def trigger_runs_query_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRunsQueryResponse - end - def integration_runtime_data_flow_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataFlowProperties - end - def operation_metric_dimension - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricDimension - end - def integration_runtime_vnet_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeVNetProperties - end - def operation_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationListResponse - end - def integration_runtime_ssis_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisProperties - end - def exposure_control_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlResponse - end - def integration_runtime_ssis_catalog_info - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisCatalogInfo - end - def data_flow_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowListResponse - end - def dataset_location - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetLocation - end - def ssisexecution_parameter - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionParameter - end - def integration_runtime_custom_setup_script_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeCustomSetupScriptProperties - end - def linked_service - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedService - end - def integration_runtime_data_proxy_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataProxyProperties - end - def user_property - Azure::DataFactory::Mgmt::V2018_06_01::Models::UserProperty - end - def entity_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::EntityReference - end - def create_run_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateRunResponse - end - def custom_setup_base - Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomSetupBase - end - def user_access_policy - Azure::DataFactory::Mgmt::V2018_06_01::Models::UserAccessPolicy - end - def linked_integration_runtime_type - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeType - end - def trigger_filter_parameters - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerFilterParameters - end - def managed_integration_runtime_node - Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeNode - end - def activity_runs_query_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRunsQueryResponse - end - def managed_integration_runtime_error - Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeError - end - def operation_service_specification - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationServiceSpecification - end - def managed_integration_runtime_operation_result - Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeOperationResult - end - def data_flow - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlow - end - def self_hosted_integration_runtime_node - Azure::DataFactory::Mgmt::V2018_06_01::Models::SelfHostedIntegrationRuntimeNode - end - def update_integration_runtime_node_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeNodeRequest - end - def linked_integration_runtime - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntime - end - def trigger - Azure::DataFactory::Mgmt::V2018_06_01::Models::Trigger - end - def trigger_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerReference - end - def factory_update_parameters - Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryUpdateParameters - end - def switch_case - Azure::DataFactory::Mgmt::V2018_06_01::Models::SwitchCase - end - def operation_log_specification - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationLogSpecification + def data_flow_debug_package_debug_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackageDebugSettings end def copy_sink Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySink end + def data_flow_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowListResponse + end + def azure_mlweb_service_file + Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLWebServiceFile + end + def create_data_flow_debug_session_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionRequest + end + def factory_identity + Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryIdentity + end def create_data_flow_debug_session_response Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionResponse end - def dependency_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::DependencyReference + def global_parameter_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::GlobalParameterSpecification end - def redirect_incompatible_row_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::RedirectIncompatibleRowSettings + def data_flow_source_setting + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSourceSetting end - def retry_policy - Azure::DataFactory::Mgmt::V2018_06_01::Models::RetryPolicy + def factory_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryListResponse end - def ssis_object_metadata_status_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataStatusResponse + def sub_resource + Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResource end - def format_write_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatWriteSettings + def staging_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::StagingSettings end - def pipeline_run_invoked_by - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunInvokedBy + def expression + Azure::DataFactory::Mgmt::V2018_06_01::Models::Expression end - def store_write_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreWriteSettings + def integration_runtime_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeReference + end + def switch_case + Azure::DataFactory::Mgmt::V2018_06_01::Models::SwitchCase + end + def integration_runtime_status + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatus + end + def data_flow_debug_package + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackage + end + def integration_runtime_status_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusListResponse + end + def add_data_flow_to_debug_session_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::AddDataFlowToDebugSessionResponse + end + def update_integration_runtime_node_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeNodeRequest + end + def delete_data_flow_debug_session_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::DeleteDataFlowDebugSessionRequest + end + def create_linked_integration_runtime_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateLinkedIntegrationRuntimeRequest + end + def data_flow_debug_command_payload + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandPayload + end + def linked_service + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedService + end + def data_flow_debug_command_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandRequest + end + def linked_service_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceListResponse + end + def data_flow_debug_command_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandResponse end def dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::Dataset end + def data_flow_debug_session_info + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugSessionInfo + end + def dataset_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetListResponse + end + def query_data_flow_debug_sessions_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::QueryDataFlowDebugSessionsResponse + end + def user_property + Azure::DataFactory::Mgmt::V2018_06_01::Models::UserProperty + end + def get_data_factory_operation_status_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::GetDataFactoryOperationStatusResponse + end + def variable_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::VariableSpecification + end + def data_flow_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowReference + end + def dwcopy_command_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandSettings + end + def ssisproperty_override + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPropertyOverride + end + def trigger + Azure::DataFactory::Mgmt::V2018_06_01::Models::Trigger + end + def format_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatReadSettings + end + def trigger_query_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerQueryResponse + end + def transformation + Azure::DataFactory::Mgmt::V2018_06_01::Models::Transformation + end + def create_run_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateRunResponse + end + def distcp_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::DistcpSettings + end + def trigger_subscription_operation_status + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerSubscriptionOperationStatus + end + def ssislog_location + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISLogLocation + end + def format_write_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatWriteSettings + end + def ssisaccess_credential + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISAccessCredential + end + def git_hub_access_token_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenRequest + end + def custom_activity_reference_object + Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomActivityReferenceObject + end + def user_access_policy + Azure::DataFactory::Mgmt::V2018_06_01::Models::UserAccessPolicy + end + def log_storage_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::LogStorageSettings + end + def pipeline_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineReference + end + def copy_source + Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySource + end + def factory_update_parameters + Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryUpdateParameters + end + def sap_hana_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::SapHanaPartitionSettings + end + def execute_data_flow_activity_type_properties_compute + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivityTypePropertiesCompute + end + def sap_table_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTablePartitionSettings + end + def trigger_filter_parameters + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerFilterParameters + end + def stored_procedure_parameter + Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameter + end + def run_query_order_by + Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryOrderBy + end + def sql_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlPartitionSettings + end + def pipeline_run_invoked_by + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunInvokedBy + end + def teradata_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionSettings + end + def pipeline_runs_query_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunsQueryResponse + end + def netezza_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::NetezzaPartitionSettings + end + def activity_runs_query_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRunsQueryResponse + end + def script_action + Azure::DataFactory::Mgmt::V2018_06_01::Models::ScriptAction + end + def trigger_runs_query_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRunsQueryResponse + end + def store_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreReadSettings + end + def operation_log_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationLogSpecification + end + def redshift_unload_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::RedshiftUnloadSettings + end + def operation_metric_dimension + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricDimension + end + def web_activity_authentication + Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivityAuthentication + end + def operation_service_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationServiceSpecification + end + def oracle_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::OraclePartitionSettings + end + def operation_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationListResponse + end + def mongo_db_cursor_methods_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::MongoDbCursorMethodsProperties + end + def ssis_object_metadata_status_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataStatusResponse + end + def export_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExportSettings + end + def exposure_control_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlResponse + end + def additional_columns + Azure::DataFactory::Mgmt::V2018_06_01::Models::AdditionalColumns + end + def data_flow + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlow + end + def ssisexecution_parameter + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionParameter + end + def secret_base + Azure::DataFactory::Mgmt::V2018_06_01::Models::SecretBase + end + def ssisexecution_credential + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionCredential + end + def redirect_incompatible_row_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::RedirectIncompatibleRowSettings + end + def ssischild_package + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISChildPackage + end + def integration_runtime_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeListResponse + end + def compression_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::CompressionReadSettings + end + def integration_runtime_status_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusResponse + end + def ssispackage_location + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPackageLocation + end + def linked_integration_runtime_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeRequest + end + def integration_runtime_connection_info + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeConnectionInfo + end + def dwcopy_command_default_value + Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandDefaultValue + end + def integration_runtime_regenerate_key_parameters + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeRegenerateKeyParameters + end + def web_linked_service_type_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::WebLinkedServiceTypeProperties + end + def integration_runtime_auth_keys + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeAuthKeys + end + def activity + Azure::DataFactory::Mgmt::V2018_06_01::Models::Activity + end + def integration_runtime_monitoring_data + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeMonitoringData + end + def pipeline_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineListResponse + end + def integration_runtime_node_monitoring_data + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeMonitoringData + end + def trigger_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerListResponse + end + def ssis_object_metadata_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataListResponse + end + def store_write_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreWriteSettings + end + def ssis_object_metadata + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadata + end + def git_hub_access_token_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenResponse + end + def dataset_storage_format + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetStorageFormat + end + def trigger_pipeline_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerPipelineReference + end + def ssis_environment_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisEnvironmentReference + end + def activity_policy + Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityPolicy + end + def ssis_parameter + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisParameter + end + def run_filter_parameters + Azure::DataFactory::Mgmt::V2018_06_01::Models::RunFilterParameters + end + def ssis_variable + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisVariable + end + def activity_run + Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRun + end + def dataset_location + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetLocation + end + def operation_display + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationDisplay + end + def integration_runtime_node_ip_address + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeIpAddress + end + def operation_metric_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricSpecification + end + def dataset_compression + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetCompression + end + def get_ssis_object_metadata_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::GetSsisObjectMetadataRequest + end + def integration_runtime_compute_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeComputeProperties + end + def data_flow_folder + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowFolder + end + def integration_runtime_data_flow_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataFlowProperties + end + def factory_repo_configuration + Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoConfiguration + end + def integration_runtime_vnet_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeVNetProperties + end + def import_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::ImportSettings + end + def integration_runtime_ssis_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisProperties + end + def parameter_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::ParameterSpecification + end + def integration_runtime_ssis_catalog_info + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisCatalogInfo + end + def activity_dependency + Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityDependency + end + def integration_runtime_custom_setup_script_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeCustomSetupScriptProperties + end def polybase_settings Azure::DataFactory::Mgmt::V2018_06_01::Models::PolybaseSettings end + def integration_runtime_data_proxy_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataProxyProperties + end + def factory_repo_update + Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoUpdate + end + def custom_setup_base + Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomSetupBase + end + def dataset_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetReference + end + def package_store + Azure::DataFactory::Mgmt::V2018_06_01::Models::PackageStore + end + def pipeline_run + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRun + end + def entity_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::EntityReference + end + def operation_metric_availability + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricAvailability + end + def linked_integration_runtime_type + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeType + end + def exposure_control_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlRequest + end + def trigger_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerReference + end + def integration_runtime + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntime + end + def managed_integration_runtime_node + Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeNode + end + def dataset_folder + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetFolder + end + def managed_integration_runtime_error + Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeError + end + def dependency_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::DependencyReference + end + def run_query_filter + Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryFilter + end + def retry_policy + Azure::DataFactory::Mgmt::V2018_06_01::Models::RetryPolicy + end + def operation + Azure::DataFactory::Mgmt::V2018_06_01::Models::Operation + end + def managed_integration_runtime_operation_result + Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeOperationResult + end + def update_integration_runtime_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeRequest + end + def self_hosted_integration_runtime_node + Azure::DataFactory::Mgmt::V2018_06_01::Models::SelfHostedIntegrationRuntimeNode + end + def access_policy_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::AccessPolicyResponse + end + def linked_integration_runtime + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntime + end + def linked_service_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceReference + end + def recurrence_schedule_occurrence + Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceScheduleOccurrence + end + def trigger_run + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRun + end + def recurrence_schedule + Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceSchedule + end + def pipeline_folder + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineFolder + end + def schedule_trigger_recurrence + Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTriggerRecurrence + end def secure_string Azure::DataFactory::Mgmt::V2018_06_01::Models::SecureString end @@ -1262,6 +1305,12 @@ module Azure::Profiles::Latest def mapping_data_flow Azure::DataFactory::Mgmt::V2018_06_01::Models::MappingDataFlow end + def share_point_online_list_linked_service + Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListLinkedService + end + def snowflake_linked_service + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeLinkedService + end def azure_function_linked_service Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFunctionLinkedService end @@ -1553,6 +1602,12 @@ module Azure::Profiles::Latest def azure_storage_linked_service Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureStorageLinkedService end + def share_point_online_list_resource_dataset + Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListResourceDataset + end + def snowflake_dataset + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeDataset + end def google_ad_words_object_dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleAdWordsObjectDataset end @@ -1859,6 +1914,9 @@ module Azure::Profiles::Latest def orc_dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::OrcDataset end + def xml_dataset + Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlDataset + end def json_dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonDataset end @@ -1868,6 +1926,9 @@ module Azure::Profiles::Latest def parquet_dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::ParquetDataset end + def excel_dataset + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExcelDataset + end def avro_dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::AvroDataset end @@ -1904,9 +1965,6 @@ module Azure::Profiles::Latest def schedule_trigger Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTrigger end - def execution_activity - Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecutionActivity - end def execute_data_flow_activity Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivity end @@ -1934,12 +1992,69 @@ module Azure::Profiles::Latest def azure_mlbatch_execution_activity Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLBatchExecutionActivity end + def zip_deflate_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::ZipDeflateReadSettings + end + def binary_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::BinaryReadSettings + end + def xml_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlReadSettings + end + def json_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonReadSettings + end + def delimited_text_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextReadSettings + end + def hdfs_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::HdfsReadSettings + end + def http_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpReadSettings + end + def sftp_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::SftpReadSettings + end + def ftp_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::FtpReadSettings + end + def google_cloud_storage_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleCloudStorageReadSettings + end + def azure_file_storage_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFileStorageReadSettings + end + def file_server_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::FileServerReadSettings + end + def amazon_s3_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::AmazonS3ReadSettings + end + def azure_data_lake_store_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreReadSettings + end + def azure_blob_fsread_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSReadSettings + end + def azure_blob_storage_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageReadSettings + end def get_metadata_activity Azure::DataFactory::Mgmt::V2018_06_01::Models::GetMetadataActivity end def web_activity Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivity end + def share_point_online_list_source + Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListSource + end + def snowflake_export_copy_command + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeExportCopyCommand + end + def snowflake_source + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeSource + end def http_source Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpSource end @@ -2183,57 +2298,27 @@ module Azure::Profiles::Latest def azure_table_source Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureTableSource end - def hdfs_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::HdfsReadSettings - end - def http_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpReadSettings - end - def sftp_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::SftpReadSettings - end - def ftp_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::FtpReadSettings - end - def google_cloud_storage_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleCloudStorageReadSettings - end - def azure_file_storage_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFileStorageReadSettings - end - def file_server_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::FileServerReadSettings - end - def amazon_s3_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::AmazonS3ReadSettings - end - def azure_data_lake_store_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreReadSettings - end - def azure_blob_fsread_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSReadSettings - end - def azure_blob_storage_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageReadSettings - end def binary_source Azure::DataFactory::Mgmt::V2018_06_01::Models::BinarySource end def orc_source Azure::DataFactory::Mgmt::V2018_06_01::Models::OrcSource end + def xml_source + Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlSource + end def json_source Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonSource end - def delimited_text_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextReadSettings - end def delimited_text_source Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextSource end def parquet_source Azure::DataFactory::Mgmt::V2018_06_01::Models::ParquetSource end + def excel_source + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExcelSource + end def avro_source Azure::DataFactory::Mgmt::V2018_06_01::Models::AvroSource end @@ -2312,6 +2397,12 @@ module Azure::Profiles::Latest def oracle_sink Azure::DataFactory::Mgmt::V2018_06_01::Models::OracleSink end + def snowflake_import_copy_command + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeImportCopyCommand + end + def snowflake_sink + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeSink + end def sql_dwsink Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlDWSink end @@ -2396,6 +2487,9 @@ module Azure::Profiles::Latest def delimited_text_sink Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextSink end + def execution_activity + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecutionActivity + end def copy_activity Azure::DataFactory::Mgmt::V2018_06_01::Models::CopyActivity end @@ -2474,6 +2568,9 @@ module Azure::Profiles::Latest def ssis_folder Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisFolder end + def global_parameter_type + Azure::DataFactory::Mgmt::V2018_06_01::Models::GlobalParameterType + end def integration_runtime_state Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeState end @@ -2636,6 +2733,9 @@ module Azure::Profiles::Latest def teradata_partition_option Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionOption end + def sql_partition_option + Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlPartitionOption + end def stored_procedure_parameter_type Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameterType end diff --git a/azure_sdk/lib/latest/modules/eventgrid_profile_module.rb b/azure_sdk/lib/latest/modules/eventgrid_profile_module.rb index 433a46c93..67dcea84a 100644 --- a/azure_sdk/lib/latest/modules/eventgrid_profile_module.rb +++ b/azure_sdk/lib/latest/modules/eventgrid_profile_module.rb @@ -371,165 +371,109 @@ module Azure::Profiles::Latest end end module Mgmt - Domains = Azure::EventGrid::Mgmt::V2020_04_01_preview::Domains - DomainTopics = Azure::EventGrid::Mgmt::V2020_04_01_preview::DomainTopics - EventChannels = Azure::EventGrid::Mgmt::V2020_04_01_preview::EventChannels - EventSubscriptions = Azure::EventGrid::Mgmt::V2020_04_01_preview::EventSubscriptions - SystemTopicEventSubscriptions = Azure::EventGrid::Mgmt::V2020_04_01_preview::SystemTopicEventSubscriptions - PartnerTopicEventSubscriptions = Azure::EventGrid::Mgmt::V2020_04_01_preview::PartnerTopicEventSubscriptions - Operations = Azure::EventGrid::Mgmt::V2020_04_01_preview::Operations - PartnerNamespaces = Azure::EventGrid::Mgmt::V2020_04_01_preview::PartnerNamespaces - PartnerRegistrations = Azure::EventGrid::Mgmt::V2020_04_01_preview::PartnerRegistrations - PartnerTopics = Azure::EventGrid::Mgmt::V2020_04_01_preview::PartnerTopics - PrivateEndpointConnections = Azure::EventGrid::Mgmt::V2020_04_01_preview::PrivateEndpointConnections - PrivateLinkResources = Azure::EventGrid::Mgmt::V2020_04_01_preview::PrivateLinkResources - SystemTopics = Azure::EventGrid::Mgmt::V2020_04_01_preview::SystemTopics - Topics = Azure::EventGrid::Mgmt::V2020_04_01_preview::Topics - ExtensionTopics = Azure::EventGrid::Mgmt::V2020_04_01_preview::ExtensionTopics - TopicTypes = Azure::EventGrid::Mgmt::V2020_04_01_preview::TopicTypes + Domains = Azure::EventGrid::Mgmt::V2020_06_01::Domains + DomainTopics = Azure::EventGrid::Mgmt::V2020_06_01::DomainTopics + EventSubscriptions = Azure::EventGrid::Mgmt::V2020_06_01::EventSubscriptions + Operations = Azure::EventGrid::Mgmt::V2020_06_01::Operations + Topics = Azure::EventGrid::Mgmt::V2020_06_01::Topics + PrivateEndpointConnections = Azure::EventGrid::Mgmt::V2020_06_01::PrivateEndpointConnections + PrivateLinkResources = Azure::EventGrid::Mgmt::V2020_06_01::PrivateLinkResources + TopicTypes = Azure::EventGrid::Mgmt::V2020_06_01::TopicTypes module Models - PartnerTopicTypesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicTypesListResult - PrivateEndpoint = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpoint - PartnerTopicsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicsListResult - PartnerNamespacesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespacesListResult - PartnerNamespaceUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceUpdateParameters - InboundIpRule = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InboundIpRule - PrivateLinkResource = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateLinkResource - UserIdentityProperties = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::UserIdentityProperties - OperationsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::OperationsListResult - Resource = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Resource - Operation = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Operation - JsonFieldWithDefault = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonFieldWithDefault - OperationInfo = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::OperationInfo - PartnerRegistrationEventTypesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationEventTypesListResult - EventSubscriptionsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionsListResult - DomainUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainUpdateParameters - ConnectionState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ConnectionState - DomainSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainSharedAccessKeys - EventSubscriptionFullUrl = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionFullUrl - PartnerRegistrationsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationsListResult - EventChannelsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelsListResult - EventChannelSource = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelSource - EventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionDestination - AdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::AdvancedFilter - EventSubscriptionIdentity = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionIdentity - PartnerRegistrationUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationUpdateParameters - DeliveryWithResourceIdentity = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeliveryWithResourceIdentity - PartnerNamespaceRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceRegenerateKeyRequest - EventSubscriptionFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionFilter - InputSchemaMapping = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InputSchemaMapping - RetryPolicy = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::RetryPolicy - IdentityInfo = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IdentityInfo - DeadLetterDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeadLetterDestination - PartnerTopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicUpdateParameters - DeadLetterWithResourceIdentity = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeadLetterWithResourceIdentity - DomainsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainsListResult - DomainTopicsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopicsListResult - TopicTypesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypesListResult - EventChannelFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelFilter - TopicRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicRegenerateKeyRequest - PartnerNamespaceSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceSharedAccessKeys - TopicSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicSharedAccessKeys - JsonField = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonField - TopicsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicsListResult - DomainRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainRegenerateKeyRequest - TopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicUpdateParameters - PrivateEndpointConnectionListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpointConnectionListResult - SystemTopicsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopicsListResult - EventTypesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventTypesListResult - SystemTopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopicUpdateParameters - ResourceSku = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceSku - PrivateLinkResourcesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateLinkResourcesListResult - EventChannelDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelDestination - EventSubscriptionUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionUpdateParameters - PrivateEndpointConnection = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpointConnection - JsonInputSchemaMapping = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonInputSchemaMapping - TrackedResource = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TrackedResource - Domain = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Domain - DomainTopic = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopic - NumberInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberInAdvancedFilter - NumberNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberNotInAdvancedFilter - NumberLessThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberLessThanAdvancedFilter - NumberGreaterThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberGreaterThanAdvancedFilter - NumberLessThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberLessThanOrEqualsAdvancedFilter - NumberGreaterThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberGreaterThanOrEqualsAdvancedFilter - BoolEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::BoolEqualsAdvancedFilter - StringInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringInAdvancedFilter - StringNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringNotInAdvancedFilter - StringBeginsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringBeginsWithAdvancedFilter - StringEndsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringEndsWithAdvancedFilter - StringContainsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringContainsAdvancedFilter - EventChannel = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannel - StorageBlobDeadLetterDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StorageBlobDeadLetterDestination - WebHookEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::WebHookEventSubscriptionDestination - EventHubEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventHubEventSubscriptionDestination - StorageQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StorageQueueEventSubscriptionDestination - HybridConnectionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::HybridConnectionEventSubscriptionDestination - ServiceBusQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ServiceBusQueueEventSubscriptionDestination - ServiceBusTopicEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ServiceBusTopicEventSubscriptionDestination - AzureFunctionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::AzureFunctionEventSubscriptionDestination - EventSubscription = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscription - PartnerNamespace = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespace - PartnerRegistration = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistration - EventType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventType - PartnerTopic = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopic - PartnerTopicType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicType - SystemTopic = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopic - Topic = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Topic - ExtensionTopic = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ExtensionTopic - TopicTypeInfo = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypeInfo - PersistedConnectionStatus = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PersistedConnectionStatus - ResourceProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceProvisioningState - DomainProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainProvisioningState - InputSchema = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InputSchema - PublicNetworkAccess = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PublicNetworkAccess - IpActionType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IpActionType - Sku = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Sku - IdentityType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IdentityType - DomainTopicProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopicProvisioningState - EventChannelProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelProvisioningState - PartnerTopicReadinessState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicReadinessState - EventSubscriptionProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionProvisioningState - EventSubscriptionIdentityType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionIdentityType - EventDeliverySchema = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventDeliverySchema - PartnerNamespaceProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceProvisioningState - PartnerRegistrationProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationProvisioningState - PartnerRegistrationVisibilityState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationVisibilityState - PartnerTopicProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicProvisioningState - PartnerTopicActivationState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicActivationState - PartnerTopicTypeAuthorizationState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicTypeAuthorizationState - TopicProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicProvisioningState - ResourceRegionType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceRegionType - TopicTypeProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypeProvisioningState + AdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::AdvancedFilter + EventSubscriptionFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFilter + ConnectionState = Azure::EventGrid::Mgmt::V2020_06_01::Models::ConnectionState + RetryPolicy = Azure::EventGrid::Mgmt::V2020_06_01::Models::RetryPolicy + InputSchemaMapping = Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchemaMapping + DeadLetterDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::DeadLetterDestination + Resource = Azure::EventGrid::Mgmt::V2020_06_01::Models::Resource + EventSubscriptionsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult + JsonFieldWithDefault = Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonFieldWithDefault + EventSubscriptionFullUrl = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFullUrl + JsonField = Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonField + TopicSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicSharedAccessKeys + DomainUpdateParameters = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainUpdateParameters + TopicsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicsListResult + DomainSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainSharedAccessKeys + EventSubscriptionUpdateParameters = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionUpdateParameters + TopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicUpdateParameters + OperationInfo = Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationInfo + EventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionDestination + Operation = Azure::EventGrid::Mgmt::V2020_06_01::Models::Operation + TopicRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicRegenerateKeyRequest + InboundIpRule = Azure::EventGrid::Mgmt::V2020_06_01::Models::InboundIpRule + OperationsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationsListResult + DomainsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainsListResult + PrivateEndpointConnectionListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnectionListResult + DomainTopicsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicsListResult + PrivateLinkResource = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResource + PrivateLinkResourcesListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResourcesListResult + PrivateEndpoint = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpoint + TopicTypesListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypesListResult + DomainRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainRegenerateKeyRequest + EventTypesListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventTypesListResult + PrivateEndpointConnection = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnection + JsonInputSchemaMapping = Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonInputSchemaMapping + TrackedResource = Azure::EventGrid::Mgmt::V2020_06_01::Models::TrackedResource + Domain = Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain + DomainTopic = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopic + NumberInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberInAdvancedFilter + StorageBlobDeadLetterDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageBlobDeadLetterDestination + NumberNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberNotInAdvancedFilter + NumberLessThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanAdvancedFilter + NumberGreaterThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanAdvancedFilter + NumberLessThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanOrEqualsAdvancedFilter + NumberGreaterThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanOrEqualsAdvancedFilter + BoolEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::BoolEqualsAdvancedFilter + StringInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringInAdvancedFilter + StringNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringNotInAdvancedFilter + StringBeginsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringBeginsWithAdvancedFilter + StringEndsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringEndsWithAdvancedFilter + StringContainsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringContainsAdvancedFilter + WebHookEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::WebHookEventSubscriptionDestination + EventHubEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventHubEventSubscriptionDestination + StorageQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageQueueEventSubscriptionDestination + HybridConnectionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::HybridConnectionEventSubscriptionDestination + ServiceBusQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusQueueEventSubscriptionDestination + ServiceBusTopicEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusTopicEventSubscriptionDestination + AzureFunctionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::AzureFunctionEventSubscriptionDestination + EventSubscription = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription + Topic = Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic + EventType = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventType + TopicTypeInfo = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeInfo + PersistedConnectionStatus = Azure::EventGrid::Mgmt::V2020_06_01::Models::PersistedConnectionStatus + ResourceProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceProvisioningState + DomainProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainProvisioningState + InputSchema = Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchema + PublicNetworkAccess = Azure::EventGrid::Mgmt::V2020_06_01::Models::PublicNetworkAccess + IpActionType = Azure::EventGrid::Mgmt::V2020_06_01::Models::IpActionType + DomainTopicProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicProvisioningState + EventSubscriptionProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionProvisioningState + EventDeliverySchema = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventDeliverySchema + TopicProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicProvisioningState + ResourceRegionType = Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceRegionType + TopicTypeProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeProvisioningState end class EventGridManagementClass - attr_reader :domains, :domain_topics, :event_channels, :event_subscriptions, :system_topic_event_subscriptions, :partner_topic_event_subscriptions, :operations, :partner_namespaces, :partner_registrations, :partner_topics, :private_endpoint_connections, :private_link_resources, :system_topics, :topics, :extension_topics, :topic_types, :configurable, :base_url, :options, :model_classes + attr_reader :domains, :domain_topics, :event_subscriptions, :operations, :topics, :private_endpoint_connections, :private_link_resources, :topic_types, :configurable, :base_url, :options, :model_classes def initialize(configurable, base_url=nil, options=nil) @configurable, @base_url, @options = configurable, base_url, options - @client_0 = Azure::EventGrid::Mgmt::V2020_04_01_preview::EventGridManagementClient.new(configurable.credentials, base_url, options) + @client_0 = Azure::EventGrid::Mgmt::V2020_06_01::EventGridManagementClient.new(configurable.credentials, base_url, options) if(@client_0.respond_to?(:subscription_id)) @client_0.subscription_id = configurable.subscription_id end add_telemetry(@client_0) @domains = @client_0.domains @domain_topics = @client_0.domain_topics - @event_channels = @client_0.event_channels @event_subscriptions = @client_0.event_subscriptions - @system_topic_event_subscriptions = @client_0.system_topic_event_subscriptions - @partner_topic_event_subscriptions = @client_0.partner_topic_event_subscriptions @operations = @client_0.operations - @partner_namespaces = @client_0.partner_namespaces - @partner_registrations = @client_0.partner_registrations - @partner_topics = @client_0.partner_topics + @topics = @client_0.topics @private_endpoint_connections = @client_0.private_endpoint_connections @private_link_resources = @client_0.private_link_resources - @system_topics = @client_0.system_topics - @topics = @client_0.topics - @extension_topics = @client_0.extension_topics @topic_types = @client_0.topic_types @model_classes = ModelClasses.new @@ -549,344 +493,224 @@ module Azure::Profiles::Latest end class ModelClasses - def partner_topic_types_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicTypesListResult - end - def private_endpoint - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpoint - end - def partner_topics_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicsListResult - end - def partner_namespaces_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespacesListResult - end - def partner_namespace_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceUpdateParameters - end - def inbound_ip_rule - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InboundIpRule - end - def private_link_resource - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateLinkResource - end - def user_identity_properties - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::UserIdentityProperties - end - def operations_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::OperationsListResult - end - def resource - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Resource - end - def operation - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Operation - end - def json_field_with_default - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonFieldWithDefault - end - def operation_info - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::OperationInfo - end - def partner_registration_event_types_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationEventTypesListResult - end - def event_subscriptions_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionsListResult - end - def domain_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainUpdateParameters - end - def connection_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ConnectionState - end - def domain_shared_access_keys - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainSharedAccessKeys - end - def event_subscription_full_url - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionFullUrl - end - def partner_registrations_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationsListResult - end - def event_channels_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelsListResult - end - def event_channel_source - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelSource - end - def event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionDestination - end def advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::AdvancedFilter - end - def event_subscription_identity - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionIdentity - end - def partner_registration_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationUpdateParameters - end - def delivery_with_resource_identity - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeliveryWithResourceIdentity - end - def partner_namespace_regenerate_key_request - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceRegenerateKeyRequest + Azure::EventGrid::Mgmt::V2020_06_01::Models::AdvancedFilter end def event_subscription_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionFilter + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFilter end - def input_schema_mapping - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InputSchemaMapping + def connection_state + Azure::EventGrid::Mgmt::V2020_06_01::Models::ConnectionState end def retry_policy - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::RetryPolicy + Azure::EventGrid::Mgmt::V2020_06_01::Models::RetryPolicy end - def identity_info - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IdentityInfo + def input_schema_mapping + Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchemaMapping end def dead_letter_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeadLetterDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::DeadLetterDestination end - def partner_topic_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicUpdateParameters + def resource + Azure::EventGrid::Mgmt::V2020_06_01::Models::Resource end - def dead_letter_with_resource_identity - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeadLetterWithResourceIdentity + def event_subscriptions_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult end - def domains_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainsListResult + def json_field_with_default + Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonFieldWithDefault end - def domain_topics_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopicsListResult - end - def topic_types_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypesListResult - end - def event_channel_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelFilter - end - def topic_regenerate_key_request - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicRegenerateKeyRequest - end - def partner_namespace_shared_access_keys - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceSharedAccessKeys - end - def topic_shared_access_keys - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicSharedAccessKeys + def event_subscription_full_url + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFullUrl end def json_field - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonField + Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonField + end + def topic_shared_access_keys + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicSharedAccessKeys + end + def domain_update_parameters + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainUpdateParameters end def topics_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicsListResult + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicsListResult end - def domain_regenerate_key_request - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainRegenerateKeyRequest - end - def topic_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicUpdateParameters - end - def private_endpoint_connection_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpointConnectionListResult - end - def system_topics_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopicsListResult - end - def event_types_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventTypesListResult - end - def system_topic_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopicUpdateParameters - end - def resource_sku - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceSku - end - def private_link_resources_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateLinkResourcesListResult - end - def event_channel_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelDestination + def domain_shared_access_keys + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainSharedAccessKeys end def event_subscription_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionUpdateParameters + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionUpdateParameters + end + def topic_update_parameters + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicUpdateParameters + end + def operation_info + Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationInfo + end + def event_subscription_destination + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionDestination + end + def operation + Azure::EventGrid::Mgmt::V2020_06_01::Models::Operation + end + def topic_regenerate_key_request + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicRegenerateKeyRequest + end + def inbound_ip_rule + Azure::EventGrid::Mgmt::V2020_06_01::Models::InboundIpRule + end + def operations_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationsListResult + end + def domains_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainsListResult + end + def private_endpoint_connection_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnectionListResult + end + def domain_topics_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicsListResult + end + def private_link_resource + Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResource + end + def private_link_resources_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResourcesListResult + end + def private_endpoint + Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpoint + end + def topic_types_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypesListResult + end + def domain_regenerate_key_request + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainRegenerateKeyRequest + end + def event_types_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventTypesListResult end def private_endpoint_connection - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpointConnection + Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnection end def json_input_schema_mapping - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonInputSchemaMapping + Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonInputSchemaMapping end def tracked_resource - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TrackedResource + Azure::EventGrid::Mgmt::V2020_06_01::Models::TrackedResource end def domain - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Domain + Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain end def domain_topic - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopic + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopic end def number_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberInAdvancedFilter - end - def number_not_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberNotInAdvancedFilter - end - def number_less_than_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberLessThanAdvancedFilter - end - def number_greater_than_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberGreaterThanAdvancedFilter - end - def number_less_than_or_equals_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberLessThanOrEqualsAdvancedFilter - end - def number_greater_than_or_equals_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberGreaterThanOrEqualsAdvancedFilter - end - def bool_equals_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::BoolEqualsAdvancedFilter - end - def string_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringInAdvancedFilter - end - def string_not_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringNotInAdvancedFilter - end - def string_begins_with_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringBeginsWithAdvancedFilter - end - def string_ends_with_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringEndsWithAdvancedFilter - end - def string_contains_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringContainsAdvancedFilter - end - def event_channel - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannel + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberInAdvancedFilter end def storage_blob_dead_letter_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StorageBlobDeadLetterDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageBlobDeadLetterDestination + end + def number_not_in_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberNotInAdvancedFilter + end + def number_less_than_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanAdvancedFilter + end + def number_greater_than_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanAdvancedFilter + end + def number_less_than_or_equals_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanOrEqualsAdvancedFilter + end + def number_greater_than_or_equals_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanOrEqualsAdvancedFilter + end + def bool_equals_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::BoolEqualsAdvancedFilter + end + def string_in_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::StringInAdvancedFilter + end + def string_not_in_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::StringNotInAdvancedFilter + end + def string_begins_with_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::StringBeginsWithAdvancedFilter + end + def string_ends_with_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::StringEndsWithAdvancedFilter + end + def string_contains_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::StringContainsAdvancedFilter end def web_hook_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::WebHookEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::WebHookEventSubscriptionDestination end def event_hub_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventHubEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventHubEventSubscriptionDestination end def storage_queue_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StorageQueueEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageQueueEventSubscriptionDestination end def hybrid_connection_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::HybridConnectionEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::HybridConnectionEventSubscriptionDestination end def service_bus_queue_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ServiceBusQueueEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusQueueEventSubscriptionDestination end def service_bus_topic_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ServiceBusTopicEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusTopicEventSubscriptionDestination end def azure_function_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::AzureFunctionEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::AzureFunctionEventSubscriptionDestination end def event_subscription - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscription - end - def partner_namespace - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespace - end - def partner_registration - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistration - end - def event_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventType - end - def partner_topic - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopic - end - def partner_topic_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicType - end - def system_topic - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopic + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription end def topic - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Topic + Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic end - def extension_topic - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ExtensionTopic + def event_type + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventType end def topic_type_info - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypeInfo + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeInfo end def persisted_connection_status - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PersistedConnectionStatus + Azure::EventGrid::Mgmt::V2020_06_01::Models::PersistedConnectionStatus end def resource_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceProvisioningState + Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceProvisioningState end def domain_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainProvisioningState + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainProvisioningState end def input_schema - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InputSchema + Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchema end def public_network_access - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PublicNetworkAccess + Azure::EventGrid::Mgmt::V2020_06_01::Models::PublicNetworkAccess end def ip_action_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IpActionType - end - def sku - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Sku - end - def identity_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IdentityType + Azure::EventGrid::Mgmt::V2020_06_01::Models::IpActionType end def domain_topic_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopicProvisioningState - end - def event_channel_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelProvisioningState - end - def partner_topic_readiness_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicReadinessState + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicProvisioningState end def event_subscription_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionProvisioningState - end - def event_subscription_identity_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionIdentityType + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionProvisioningState end def event_delivery_schema - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventDeliverySchema - end - def partner_namespace_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceProvisioningState - end - def partner_registration_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationProvisioningState - end - def partner_registration_visibility_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationVisibilityState - end - def partner_topic_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicProvisioningState - end - def partner_topic_activation_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicActivationState - end - def partner_topic_type_authorization_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicTypeAuthorizationState + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventDeliverySchema end def topic_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicProvisioningState + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicProvisioningState end def resource_region_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceRegionType + Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceRegionType end def topic_type_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypeProvisioningState + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeProvisioningState end end end diff --git a/azure_sdk/lib/latest/modules/hdinsight_profile_module.rb b/azure_sdk/lib/latest/modules/hdinsight_profile_module.rb index 23ac023ca..efc26ab5c 100644 --- a/azure_sdk/lib/latest/modules/hdinsight_profile_module.rb +++ b/azure_sdk/lib/latest/modules/hdinsight_profile_module.rb @@ -19,81 +19,80 @@ module Azure::Profiles::Latest module Models ClusterDiskEncryptionParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDiskEncryptionParameters - UpdateGatewaySettingsParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UpdateGatewaySettingsParameters - ClientGroupInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClientGroupInfo - GatewaySettings = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::GatewaySettings - SecurityProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SecurityProfile - OperationResource = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationResource - AutoscaleSchedule = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleSchedule - Resource = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Resource - AutoscaleRecurrence = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleRecurrence - AutoscaleCapacity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleCapacity - HardwareProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HardwareProfile - Autoscale = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Autoscale - DataDisksGroups = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DataDisksGroups - HostInfoListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfoListResult - SshProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshProfile - HostInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfo - OsProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OsProfile - ErrorResponse = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ErrorResponse - Role = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Role - ApplicationGetHttpsEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetHttpsEndpoint - StorageAccount = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageAccount - ApplicationGetEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetEndpoint - DiskEncryptionProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskEncryptionProperties - ApplicationProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationProperties - ClusterIdentityUserAssignedIdentitiesValue = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentityUserAssignedIdentitiesValue - OperationListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationListResult - ClusterCreateParametersExtended = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateParametersExtended - ApplicationListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationListResult - QuotaInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaInfo - VersionSpec = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionSpec - ConnectivityEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ConnectivityEndpoint - VersionsCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionsCapability - RegionsCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionsCapability - ExecuteScriptActionParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ExecuteScriptActionParameters - VmSizesCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizesCapability - ScriptActionExecutionSummary = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionSummary - VmSizeCompatibilityFilter = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilter - ClusterListRuntimeScriptActionDetailResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListRuntimeScriptActionDetailResult - RegionalQuotaCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionalQuotaCapability - ClusterResizeParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterResizeParameters - QuotaCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaCapability - KafkaRestProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::KafkaRestProperties - CapabilitiesResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::CapabilitiesResult - VirtualNetworkProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VirtualNetworkProfile - LocalizedName = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LocalizedName - LinuxOperatingSystemProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LinuxOperatingSystemProfile - Usage = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Usage - ComputeProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ComputeProfile - UsagesListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UsagesListResult - ClusterCreateProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateProperties - VmSizeCompatibilityFilterV2 = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilterV2 - ClusterPatchParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterPatchParameters - BillingMeters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingMeters - ClusterGetProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterGetProperties - DiskBillingMeters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskBillingMeters - ClusterListPersistedScriptActionsResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListPersistedScriptActionsResult - BillingResources = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResources - ClusterListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult - BillingResponseListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResponseListResult - AutoscaleTimeAndCapacity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleTimeAndCapacity - ClusterConfigurations = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterConfigurations - ScriptAction = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptAction - Extension = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Extension - ClusterIdentity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentity - ClusterMonitoringResponse = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringResponse - RuntimeScriptAction = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptAction - ClusterMonitoringRequest = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringRequest ClusterDefinition = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDefinition - ScriptActionExecutionHistoryList = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionHistoryList - StorageProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageProfile - ScriptActionPersistedGetResponseSpec = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionPersistedGetResponseSpec - Operation = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Operation + UpdateGatewaySettingsParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UpdateGatewaySettingsParameters + KafkaRestProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::KafkaRestProperties + GatewaySettings = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::GatewaySettings + AutoscaleTimeAndCapacity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleTimeAndCapacity + OperationResource = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationResource + AutoscaleCapacity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleCapacity + Resource = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Resource + Autoscale = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Autoscale + AutoscaleRecurrence = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleRecurrence + VirtualNetworkProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VirtualNetworkProfile + HardwareProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HardwareProfile SshPublicKey = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshPublicKey - ScriptActionsList = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionsList + HostInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfo + LinuxOperatingSystemProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LinuxOperatingSystemProfile + OperationListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationListResult + ScriptAction = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptAction + ErrorResponse = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ErrorResponse + ComputeProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ComputeProfile + ApplicationGetHttpsEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetHttpsEndpoint + StorageProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageProfile + ApplicationGetEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetEndpoint + ClusterCreateProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateProperties + ApplicationProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationProperties + ClusterIdentity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentity + Operation = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Operation + ClusterPatchParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterPatchParameters + ApplicationListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationListResult Errors = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Errors + VersionSpec = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionSpec + ClusterGetProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterGetProperties + VersionsCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionsCapability + RuntimeScriptAction = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptAction + RegionsCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionsCapability + ClusterListPersistedScriptActionsResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListPersistedScriptActionsResult + VmSizesCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizesCapability OperationDisplay = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationDisplay + ClusterListRuntimeScriptActionDetailResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListRuntimeScriptActionDetailResult + VmSizeCompatibilityFilter = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilter + ClusterResizeParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterResizeParameters + RegionalQuotaCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionalQuotaCapability + SecurityProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SecurityProfile + QuotaCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaCapability + DataDisksGroups = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DataDisksGroups + CapabilitiesResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::CapabilitiesResult + OsProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OsProfile + LocalizedName = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LocalizedName + StorageAccount = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageAccount + Usage = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Usage + ClusterIdentityUserAssignedIdentitiesValue = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentityUserAssignedIdentitiesValue + UsagesListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UsagesListResult + QuotaInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaInfo + VmSizeCompatibilityFilterV2 = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilterV2 + BillingMeters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingMeters + ScriptActionExecutionSummary = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionSummary + DiskBillingMeters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskBillingMeters + ClientGroupInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClientGroupInfo + BillingResources = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResources + SshProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshProfile + BillingResponseListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResponseListResult + DiskEncryptionProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskEncryptionProperties + ClusterConfigurations = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterConfigurations + ConnectivityEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ConnectivityEndpoint + Extension = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Extension + ClusterListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult + ClusterMonitoringResponse = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringResponse + Role = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Role + ClusterMonitoringRequest = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringRequest + ExecuteScriptActionParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ExecuteScriptActionParameters + ScriptActionExecutionHistoryList = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionHistoryList + ClusterCreateParametersExtended = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateParametersExtended + ScriptActionPersistedGetResponseSpec = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionPersistedGetResponseSpec + AutoscaleSchedule = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleSchedule + ScriptActionsList = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionsList RuntimeScriptActionDetail = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptActionDetail TrackedResource = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::TrackedResource Cluster = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Cluster @@ -151,231 +150,228 @@ module Azure::Profiles::Latest def cluster_disk_encryption_parameters Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDiskEncryptionParameters end + def cluster_definition + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDefinition + end def update_gateway_settings_parameters Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UpdateGatewaySettingsParameters end - def client_group_info - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClientGroupInfo - end - def gateway_settings - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::GatewaySettings - end - def security_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SecurityProfile - end - def operation_resource - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationResource - end - def autoscale_schedule - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleSchedule - end - def resource - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Resource - end - def autoscale_recurrence - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleRecurrence - end - def autoscale_capacity - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleCapacity - end - def hardware_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HardwareProfile - end - def autoscale - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Autoscale - end - def data_disks_groups - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DataDisksGroups - end - def host_info_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfoListResult - end - def ssh_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshProfile - end - def host_info - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfo - end - def os_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OsProfile - end - def error_response - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ErrorResponse - end - def role - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Role - end - def application_get_https_endpoint - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetHttpsEndpoint - end - def storage_account - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageAccount - end - def application_get_endpoint - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetEndpoint - end - def disk_encryption_properties - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskEncryptionProperties - end - def application_properties - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationProperties - end - def cluster_identity_user_assigned_identities_value - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentityUserAssignedIdentitiesValue - end - def operation_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationListResult - end - def cluster_create_parameters_extended - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateParametersExtended - end - def application_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationListResult - end - def quota_info - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaInfo - end - def version_spec - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionSpec - end - def connectivity_endpoint - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ConnectivityEndpoint - end - def versions_capability - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionsCapability - end - def regions_capability - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionsCapability - end - def execute_script_action_parameters - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ExecuteScriptActionParameters - end - def vm_sizes_capability - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizesCapability - end - def script_action_execution_summary - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionSummary - end - def vm_size_compatibility_filter - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilter - end - def cluster_list_runtime_script_action_detail_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListRuntimeScriptActionDetailResult - end - def regional_quota_capability - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionalQuotaCapability - end - def cluster_resize_parameters - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterResizeParameters - end - def quota_capability - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaCapability - end def kafka_rest_properties Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::KafkaRestProperties end - def capabilities_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::CapabilitiesResult - end - def virtual_network_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VirtualNetworkProfile - end - def localized_name - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LocalizedName - end - def linux_operating_system_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LinuxOperatingSystemProfile - end - def usage - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Usage - end - def compute_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ComputeProfile - end - def usages_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UsagesListResult - end - def cluster_create_properties - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateProperties - end - def vm_size_compatibility_filter_v2 - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilterV2 - end - def cluster_patch_parameters - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterPatchParameters - end - def billing_meters - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingMeters - end - def cluster_get_properties - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterGetProperties - end - def disk_billing_meters - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskBillingMeters - end - def cluster_list_persisted_script_actions_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListPersistedScriptActionsResult - end - def billing_resources - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResources - end - def cluster_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult - end - def billing_response_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResponseListResult + def gateway_settings + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::GatewaySettings end def autoscale_time_and_capacity Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleTimeAndCapacity end - def cluster_configurations - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterConfigurations + def operation_resource + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationResource end - def script_action - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptAction + def autoscale_capacity + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleCapacity end - def extension - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Extension + def resource + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Resource end - def cluster_identity - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentity + def autoscale + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Autoscale end - def cluster_monitoring_response - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringResponse + def autoscale_recurrence + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleRecurrence end - def runtime_script_action - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptAction + def virtual_network_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VirtualNetworkProfile end - def cluster_monitoring_request - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringRequest - end - def cluster_definition - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDefinition - end - def script_action_execution_history_list - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionHistoryList - end - def storage_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageProfile - end - def script_action_persisted_get_response_spec - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionPersistedGetResponseSpec - end - def operation - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Operation + def hardware_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HardwareProfile end def ssh_public_key Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshPublicKey end - def script_actions_list - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionsList + def host_info + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfo + end + def linux_operating_system_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LinuxOperatingSystemProfile + end + def operation_list_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationListResult + end + def script_action + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptAction + end + def error_response + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ErrorResponse + end + def compute_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ComputeProfile + end + def application_get_https_endpoint + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetHttpsEndpoint + end + def storage_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageProfile + end + def application_get_endpoint + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetEndpoint + end + def cluster_create_properties + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateProperties + end + def application_properties + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationProperties + end + def cluster_identity + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentity + end + def operation + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Operation + end + def cluster_patch_parameters + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterPatchParameters + end + def application_list_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationListResult end def errors Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Errors end + def version_spec + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionSpec + end + def cluster_get_properties + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterGetProperties + end + def versions_capability + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionsCapability + end + def runtime_script_action + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptAction + end + def regions_capability + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionsCapability + end + def cluster_list_persisted_script_actions_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListPersistedScriptActionsResult + end + def vm_sizes_capability + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizesCapability + end def operation_display Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationDisplay end + def cluster_list_runtime_script_action_detail_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListRuntimeScriptActionDetailResult + end + def vm_size_compatibility_filter + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilter + end + def cluster_resize_parameters + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterResizeParameters + end + def regional_quota_capability + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionalQuotaCapability + end + def security_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SecurityProfile + end + def quota_capability + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaCapability + end + def data_disks_groups + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DataDisksGroups + end + def capabilities_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::CapabilitiesResult + end + def os_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OsProfile + end + def localized_name + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LocalizedName + end + def storage_account + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageAccount + end + def usage + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Usage + end + def cluster_identity_user_assigned_identities_value + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentityUserAssignedIdentitiesValue + end + def usages_list_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UsagesListResult + end + def quota_info + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaInfo + end + def vm_size_compatibility_filter_v2 + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilterV2 + end + def billing_meters + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingMeters + end + def script_action_execution_summary + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionSummary + end + def disk_billing_meters + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskBillingMeters + end + def client_group_info + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClientGroupInfo + end + def billing_resources + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResources + end + def ssh_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshProfile + end + def billing_response_list_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResponseListResult + end + def disk_encryption_properties + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskEncryptionProperties + end + def cluster_configurations + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterConfigurations + end + def connectivity_endpoint + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ConnectivityEndpoint + end + def extension + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Extension + end + def cluster_list_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult + end + def cluster_monitoring_response + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringResponse + end + def role + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Role + end + def cluster_monitoring_request + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringRequest + end + def execute_script_action_parameters + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ExecuteScriptActionParameters + end + def script_action_execution_history_list + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionHistoryList + end + def cluster_create_parameters_extended + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateParametersExtended + end + def script_action_persisted_get_response_spec + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionPersistedGetResponseSpec + end + def autoscale_schedule + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleSchedule + end + def script_actions_list + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionsList + end def runtime_script_action_detail Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptActionDetail end diff --git a/azure_sdk/lib/latest/modules/security_profile_module.rb b/azure_sdk/lib/latest/modules/security_profile_module.rb index 011493887..8526cd37b 100644 --- a/azure_sdk/lib/latest/modules/security_profile_module.rb +++ b/azure_sdk/lib/latest/modules/security_profile_module.rb @@ -7,16 +7,9 @@ require 'azure_mgmt_security' module Azure::Profiles::Latest module Security module Mgmt - AdaptiveNetworkHardenings = Azure::Security::Mgmt::V2015_06_01_preview::AdaptiveNetworkHardenings - AllowedConnections = Azure::Security::Mgmt::V2015_06_01_preview::AllowedConnections - AdaptiveApplicationControls = Azure::Security::Mgmt::V2015_06_01_preview::AdaptiveApplicationControls - DiscoveredSecuritySolutions = Azure::Security::Mgmt::V2015_06_01_preview::DiscoveredSecuritySolutions - ExternalSecuritySolutions = Azure::Security::Mgmt::V2015_06_01_preview::ExternalSecuritySolutions - JitNetworkAccessPolicies = Azure::Security::Mgmt::V2015_06_01_preview::JitNetworkAccessPolicies Locations = Azure::Security::Mgmt::V2015_06_01_preview::Locations Operations = Azure::Security::Mgmt::V2015_06_01_preview::Operations Tasks = Azure::Security::Mgmt::V2015_06_01_preview::Tasks - Topology = Azure::Security::Mgmt::V2015_06_01_preview::Topology AdvancedThreatProtection = Azure::Security::Mgmt::V2017_08_01_preview::AdvancedThreatProtection AutoProvisioningSettings = Azure::Security::Mgmt::V2017_08_01_preview::AutoProvisioningSettings Compliances = Azure::Security::Mgmt::V2017_08_01_preview::Compliances @@ -29,7 +22,6 @@ module Azure::Profiles::Latest RegulatoryComplianceStandards = Azure::Security::Mgmt::V2019_01_01_preview::RegulatoryComplianceStandards RegulatoryComplianceControls = Azure::Security::Mgmt::V2019_01_01_preview::RegulatoryComplianceControls RegulatoryComplianceAssessments = Azure::Security::Mgmt::V2019_01_01_preview::RegulatoryComplianceAssessments - ServerVulnerabilityAssessmentOperations = Azure::Security::Mgmt::V2019_01_01_preview::ServerVulnerabilityAssessmentOperations Alerts = Azure::Security::Mgmt::V2019_01_01::Alerts Settings = Azure::Security::Mgmt::V2019_01_01::Settings IoTSecuritySolutionsAnalytics = Azure::Security::Mgmt::V2019_08_01::IoTSecuritySolutionsAnalytics @@ -40,72 +32,26 @@ module Azure::Profiles::Latest IoTSecuritySolutions = Azure::Security::Mgmt::V2019_08_01::IoTSecuritySolutions IoTSecuritySolutionsResourceGroup = Azure::Security::Mgmt::V2019_08_01::IoTSecuritySolutionsResourceGroup IotSecuritySolution = Azure::Security::Mgmt::V2019_08_01::IotSecuritySolution + AdaptiveNetworkHardenings = Azure::Security::Mgmt::V2020_01_01::AdaptiveNetworkHardenings + AllowedConnections = Azure::Security::Mgmt::V2020_01_01::AllowedConnections + AdaptiveApplicationControls = Azure::Security::Mgmt::V2020_01_01::AdaptiveApplicationControls + AssessmentsMetadata = Azure::Security::Mgmt::V2020_01_01::AssessmentsMetadata + Assessments = Azure::Security::Mgmt::V2020_01_01::Assessments + DiscoveredSecuritySolutions = Azure::Security::Mgmt::V2020_01_01::DiscoveredSecuritySolutions + ExternalSecuritySolutions = Azure::Security::Mgmt::V2020_01_01::ExternalSecuritySolutions + JitNetworkAccessPolicies = Azure::Security::Mgmt::V2020_01_01::JitNetworkAccessPolicies + ServerVulnerabilityAssessmentOperations = Azure::Security::Mgmt::V2020_01_01::ServerVulnerabilityAssessmentOperations + Topology = Azure::Security::Mgmt::V2020_01_01::Topology module Models - ExternalSecuritySolutionList = Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionList - Rule = Azure::Security::Mgmt::V2015_06_01_preview::Models::Rule - EffectiveNetworkSecurityGroups = Azure::Security::Mgmt::V2015_06_01_preview::Models::EffectiveNetworkSecurityGroups SecurityTaskList = Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskList - AdaptiveNetworkHardeningsList = Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardeningsList - TopologyList = Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologyList - AdaptiveNetworkHardeningEnforceRequest = Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardeningEnforceRequest SecurityTaskParameters = Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskParameters - TopologyResource = Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologyResource - TopologySingleResource = Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResource - ConnectedWorkspace = Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectedWorkspace - ConnectableResource = Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectableResource - AadSolutionProperties = Azure::Security::Mgmt::V2015_06_01_preview::Models::AadSolutionProperties - AllowedConnectionsList = Azure::Security::Mgmt::V2015_06_01_preview::Models::AllowedConnectionsList - TopologySingleResourceChild = Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResourceChild - AppWhitelistingIssueSummary = Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingIssueSummary - ExternalSecuritySolutionKind1 = Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionKind1 - PublisherInfo = Azure::Security::Mgmt::V2015_06_01_preview::Models::PublisherInfo - ExternalSecuritySolutionProperties = Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionProperties - PathRecommendation = Azure::Security::Mgmt::V2015_06_01_preview::Models::PathRecommendation - AadConnectivityState1 = Azure::Security::Mgmt::V2015_06_01_preview::Models::AadConnectivityState1 - AppWhitelistingGroups = Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingGroups - JitNetworkAccessPortRule = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPortRule - DiscoveredSecuritySolution = Azure::Security::Mgmt::V2015_06_01_preview::Models::DiscoveredSecuritySolution - JitNetworkAccessPolicyVirtualMachine = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyVirtualMachine - ExternalSecuritySolution = Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolution - JitNetworkAccessRequestPort = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequestPort - JitNetworkAccessRequestVirtualMachine = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequestVirtualMachine - TopologySingleResourceParent = Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResourceParent - JitNetworkAccessRequest = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequest - AllowedConnectionsResource = Azure::Security::Mgmt::V2015_06_01_preview::Models::AllowedConnectionsResource - JitNetworkAccessPolicy = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicy - VmRecommendation = Azure::Security::Mgmt::V2015_06_01_preview::Models::VmRecommendation - JitNetworkAccessPoliciesList = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPoliciesList - AppWhitelistingGroup = Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingGroup - JitNetworkAccessPolicyInitiatePort = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiatePort - DiscoveredSecuritySolutionList = Azure::Security::Mgmt::V2015_06_01_preview::Models::DiscoveredSecuritySolutionList - JitNetworkAccessPolicyInitiateVirtualMachine = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiateVirtualMachine - JitNetworkAccessPolicyInitiateRequest = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiateRequest - Location = Azure::Security::Mgmt::V2015_06_01_preview::Models::Location - Kind = Azure::Security::Mgmt::V2015_06_01_preview::Models::Kind AppWhitelistingPutGroupData = Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingPutGroupData AscLocationList = Azure::Security::Mgmt::V2015_06_01_preview::Models::AscLocationList - ConnectedResource = Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectedResource OperationDisplay = Azure::Security::Mgmt::V2015_06_01_preview::Models::OperationDisplay OperationList = Azure::Security::Mgmt::V2015_06_01_preview::Models::OperationList - UserRecommendation = Azure::Security::Mgmt::V2015_06_01_preview::Models::UserRecommendation Operation = Azure::Security::Mgmt::V2015_06_01_preview::Models::Operation - AdaptiveNetworkHardening = Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardening - CefSolutionProperties = Azure::Security::Mgmt::V2015_06_01_preview::Models::CefSolutionProperties - CefExternalSecuritySolution = Azure::Security::Mgmt::V2015_06_01_preview::Models::CefExternalSecuritySolution - AtaSolutionProperties = Azure::Security::Mgmt::V2015_06_01_preview::Models::AtaSolutionProperties - AtaExternalSecuritySolution = Azure::Security::Mgmt::V2015_06_01_preview::Models::AtaExternalSecuritySolution - AadExternalSecuritySolution = Azure::Security::Mgmt::V2015_06_01_preview::Models::AadExternalSecuritySolution SecurityTask = Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTask - Direction = Azure::Security::Mgmt::V2015_06_01_preview::Models::Direction - TransportProtocol = Azure::Security::Mgmt::V2015_06_01_preview::Models::TransportProtocol - SecurityFamily = Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityFamily - AadConnectivityState = Azure::Security::Mgmt::V2015_06_01_preview::Models::AadConnectivityState - ExternalSecuritySolutionKind = Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionKind - Protocol = Azure::Security::Mgmt::V2015_06_01_preview::Models::Protocol - Status = Azure::Security::Mgmt::V2015_06_01_preview::Models::Status - StatusReason = Azure::Security::Mgmt::V2015_06_01_preview::Models::StatusReason - ConnectionType = Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectionType InformationProtectionKeyword = Azure::Security::Mgmt::V2017_08_01_preview::Models::InformationProtectionKeyword InformationType = Azure::Security::Mgmt::V2017_08_01_preview::Models::InformationType WorkspaceSettingList = Azure::Security::Mgmt::V2017_08_01_preview::Models::WorkspaceSettingList @@ -142,11 +88,9 @@ module Azure::Profiles::Latest RegulatoryComplianceAssessmentList = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceAssessmentList RegulatoryComplianceControlList = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceControlList RegulatoryComplianceStandardList = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceStandardList - ServerVulnerabilityAssessmentsList = Azure::Security::Mgmt::V2019_01_01_preview::Models::ServerVulnerabilityAssessmentsList RegulatoryComplianceStandard = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceStandard RegulatoryComplianceControl = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceControl RegulatoryComplianceAssessment = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceAssessment - ServerVulnerabilityAssessment = Azure::Security::Mgmt::V2019_01_01_preview::Models::ServerVulnerabilityAssessment State = Azure::Security::Mgmt::V2019_01_01_preview::Models::State AlertEntity = Azure::Security::Mgmt::V2019_01_01::Models::AlertEntity SettingsList = Azure::Security::Mgmt::V2019_01_01::Models::SettingsList @@ -170,14 +114,12 @@ module Azure::Profiles::Latest IoTSecuritySolutionAnalyticsModelList = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionAnalyticsModelList IoTSecuritySolutionsList = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionsList IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem - Resource = Azure::Security::Mgmt::V2019_08_01::Models::Resource IoTSecurityDeviceAlertsList = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecurityDeviceAlertsList IoTSecurityAlertedDevicesList = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecurityAlertedDevicesList UserDefinedResourcesProperties = Azure::Security::Mgmt::V2019_08_01::Models::UserDefinedResourcesProperties IoTSecurityAggregatedAlert = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecurityAggregatedAlert RecommendationConfigurationProperties = Azure::Security::Mgmt::V2019_08_01::Models::RecommendationConfigurationProperties IoTSecuritySolutionAnalyticsModel = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionAnalyticsModel - AscLocation = Azure::Security::Mgmt::V2019_08_01::Models::AscLocation UpdateIotSecuritySolutionData = Azure::Security::Mgmt::V2019_08_01::Models::UpdateIotSecuritySolutionData ReportedSeverity = Azure::Security::Mgmt::V2019_08_01::Models::ReportedSeverity SecuritySolutionStatus = Azure::Security::Mgmt::V2019_08_01::Models::SecuritySolutionStatus @@ -185,10 +127,94 @@ module Azure::Profiles::Latest DataSource = Azure::Security::Mgmt::V2019_08_01::Models::DataSource RecommendationType = Azure::Security::Mgmt::V2019_08_01::Models::RecommendationType RecommendationConfigStatus = Azure::Security::Mgmt::V2019_08_01::Models::RecommendationConfigStatus + ResourceDetails = Azure::Security::Mgmt::V2020_01_01::Models::ResourceDetails + Rule = Azure::Security::Mgmt::V2020_01_01::Models::Rule + AssessmentStatus = Azure::Security::Mgmt::V2020_01_01::Models::AssessmentStatus + EffectiveNetworkSecurityGroups = Azure::Security::Mgmt::V2020_01_01::Models::EffectiveNetworkSecurityGroups + AdaptiveNetworkHardeningsList = Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardeningsList + JitNetworkAccessPolicy = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicy + JitNetworkAccessPolicyInitiatePort = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiatePort + AssessmentLinks = Azure::Security::Mgmt::V2020_01_01::Models::AssessmentLinks + Location = Azure::Security::Mgmt::V2020_01_01::Models::Location + SecurityAssessmentPartnerData = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentPartnerData + ETag = Azure::Security::Mgmt::V2020_01_01::Models::ETag + TopologyList = Azure::Security::Mgmt::V2020_01_01::Models::TopologyList + Resource = Azure::Security::Mgmt::V2020_01_01::Models::Resource + SecurityAssessmentList = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentList + ConnectedResource = Azure::Security::Mgmt::V2020_01_01::Models::ConnectedResource + TopologyResource = Azure::Security::Mgmt::V2020_01_01::Models::TopologyResource + AllowedConnectionsResource = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsResource + TopologySingleResource = Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResource + ProtectionMode = Azure::Security::Mgmt::V2020_01_01::Models::ProtectionMode + DiscoveredSecuritySolution = Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolution + VmRecommendation = Azure::Security::Mgmt::V2020_01_01::Models::VmRecommendation + DiscoveredSecuritySolutionList = Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolutionList + UserRecommendation = Azure::Security::Mgmt::V2020_01_01::Models::UserRecommendation + ExternalSecuritySolution = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolution + AppWhitelistingGroup = Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroup + ExternalSecuritySolutionList = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionList + SecurityAssessmentMetadataPartnerData = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataPartnerData + TopologySingleResourceChild = Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResourceChild + JitNetworkAccessPoliciesList = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList + TopologySingleResourceParent = Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResourceParent + AdaptiveNetworkHardeningEnforceRequest = Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardeningEnforceRequest + ServerVulnerabilityAssessmentsList = Azure::Security::Mgmt::V2020_01_01::Models::ServerVulnerabilityAssessmentsList + Kind = Azure::Security::Mgmt::V2020_01_01::Models::Kind + JitNetworkAccessPolicyInitiateRequest = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiateRequest + ConnectedWorkspace = Azure::Security::Mgmt::V2020_01_01::Models::ConnectedWorkspace + AllowedConnectionsList = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList + AadSolutionProperties = Azure::Security::Mgmt::V2020_01_01::Models::AadSolutionProperties + PublisherInfo = Azure::Security::Mgmt::V2020_01_01::Models::PublisherInfo + JitNetworkAccessPolicyInitiateVirtualMachine = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiateVirtualMachine + AppWhitelistingGroups = Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroups + ExternalSecuritySolutionKind1 = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionKind1 + SecurityAssessmentMetadataList = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataList + ExternalSecuritySolutionProperties = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionProperties + Tags = Azure::Security::Mgmt::V2020_01_01::Models::Tags + AadConnectivityState1 = Azure::Security::Mgmt::V2020_01_01::Models::AadConnectivityState1 + AppWhitelistingIssueSummary = Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingIssueSummary + JitNetworkAccessPortRule = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPortRule + SecurityAssessmentMetadataProperties = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataProperties + JitNetworkAccessPolicyVirtualMachine = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyVirtualMachine + ConnectableResource = Azure::Security::Mgmt::V2020_01_01::Models::ConnectableResource + JitNetworkAccessRequestPort = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequestPort + TrackedResource = Azure::Security::Mgmt::V2020_01_01::Models::TrackedResource + JitNetworkAccessRequestVirtualMachine = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequestVirtualMachine + PathRecommendation = Azure::Security::Mgmt::V2020_01_01::Models::PathRecommendation + JitNetworkAccessRequest = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequest + AdaptiveNetworkHardening = Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardening + AscLocation = Azure::Security::Mgmt::V2020_01_01::Models::AscLocation + SecurityAssessmentMetadata = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadata + SecurityAssessment = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessment + OnPremiseResourceDetails = Azure::Security::Mgmt::V2020_01_01::Models::OnPremiseResourceDetails + AzureResourceDetails = Azure::Security::Mgmt::V2020_01_01::Models::AzureResourceDetails + CefSolutionProperties = Azure::Security::Mgmt::V2020_01_01::Models::CefSolutionProperties + CefExternalSecuritySolution = Azure::Security::Mgmt::V2020_01_01::Models::CefExternalSecuritySolution + AtaSolutionProperties = Azure::Security::Mgmt::V2020_01_01::Models::AtaSolutionProperties + AtaExternalSecuritySolution = Azure::Security::Mgmt::V2020_01_01::Models::AtaExternalSecuritySolution + AadExternalSecuritySolution = Azure::Security::Mgmt::V2020_01_01::Models::AadExternalSecuritySolution + ServerVulnerabilityAssessment = Azure::Security::Mgmt::V2020_01_01::Models::ServerVulnerabilityAssessment + Direction = Azure::Security::Mgmt::V2020_01_01::Models::Direction + TransportProtocol = Azure::Security::Mgmt::V2020_01_01::Models::TransportProtocol + Category = Azure::Security::Mgmt::V2020_01_01::Models::Category + Severity = Azure::Security::Mgmt::V2020_01_01::Models::Severity + UserImpact = Azure::Security::Mgmt::V2020_01_01::Models::UserImpact + ImplementationEffort = Azure::Security::Mgmt::V2020_01_01::Models::ImplementationEffort + Threats = Azure::Security::Mgmt::V2020_01_01::Models::Threats + AssessmentType = Azure::Security::Mgmt::V2020_01_01::Models::AssessmentType + AssessmentStatusCode = Azure::Security::Mgmt::V2020_01_01::Models::AssessmentStatusCode + SecurityFamily = Azure::Security::Mgmt::V2020_01_01::Models::SecurityFamily + AadConnectivityState = Azure::Security::Mgmt::V2020_01_01::Models::AadConnectivityState + ExternalSecuritySolutionKind = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionKind + Protocol = Azure::Security::Mgmt::V2020_01_01::Models::Protocol + Status = Azure::Security::Mgmt::V2020_01_01::Models::Status + StatusReason = Azure::Security::Mgmt::V2020_01_01::Models::StatusReason + ConnectionType = Azure::Security::Mgmt::V2020_01_01::Models::ConnectionType + ExpandEnum = Azure::Security::Mgmt::V2020_01_01::Models::ExpandEnum end class SecurityManagementClass - attr_reader :adaptive_network_hardenings, :allowed_connections, :adaptive_application_controls, :discovered_security_solutions, :external_security_solutions, :jit_network_access_policies, :locations, :operations, :tasks, :topology, :advanced_threat_protection, :auto_provisioning_settings, :compliances, :device_security_groups, :information_protection_policies, :security_contacts, :workspace_settings, :compliance_results, :pricings, :regulatory_compliance_standards, :regulatory_compliance_controls, :regulatory_compliance_assessments, :server_vulnerability_assessment_operations, :alerts, :settings, :io_tsecurity_solutions_analytics, :io_tsecurity_solutions_analytics_aggregated_alerts, :io_tsecurity_solutions_analytics_aggregated_alert, :io_tsecurity_solutions_analytics_recommendation, :io_tsecurity_solutions_analytics_recommendations, :io_tsecurity_solutions, :io_tsecurity_solutions_resource_group, :iot_security_solution, :configurable, :base_url, :options, :model_classes + attr_reader :locations, :operations, :tasks, :advanced_threat_protection, :auto_provisioning_settings, :compliances, :device_security_groups, :information_protection_policies, :security_contacts, :workspace_settings, :compliance_results, :pricings, :regulatory_compliance_standards, :regulatory_compliance_controls, :regulatory_compliance_assessments, :alerts, :settings, :io_tsecurity_solutions_analytics, :io_tsecurity_solutions_analytics_aggregated_alerts, :io_tsecurity_solutions_analytics_aggregated_alert, :io_tsecurity_solutions_analytics_recommendation, :io_tsecurity_solutions_analytics_recommendations, :io_tsecurity_solutions, :io_tsecurity_solutions_resource_group, :iot_security_solution, :adaptive_network_hardenings, :allowed_connections, :adaptive_application_controls, :assessments_metadata, :assessments, :discovered_security_solutions, :external_security_solutions, :jit_network_access_policies, :server_vulnerability_assessment_operations, :topology, :configurable, :base_url, :options, :model_classes def initialize(configurable, base_url=nil, options=nil) @configurable, @base_url, @options = configurable, base_url, options @@ -198,16 +224,9 @@ module Azure::Profiles::Latest @client_0.subscription_id = configurable.subscription_id end add_telemetry(@client_0) - @adaptive_network_hardenings = @client_0.adaptive_network_hardenings - @allowed_connections = @client_0.allowed_connections - @adaptive_application_controls = @client_0.adaptive_application_controls - @discovered_security_solutions = @client_0.discovered_security_solutions - @external_security_solutions = @client_0.external_security_solutions - @jit_network_access_policies = @client_0.jit_network_access_policies @locations = @client_0.locations @operations = @client_0.operations @tasks = @client_0.tasks - @topology = @client_0.topology @client_1 = Azure::Security::Mgmt::V2017_08_01_preview::SecurityCenter.new(configurable.credentials, base_url, options) if(@client_1.respond_to?(:subscription_id)) @@ -244,7 +263,6 @@ module Azure::Profiles::Latest @regulatory_compliance_standards = @client_4.regulatory_compliance_standards @regulatory_compliance_controls = @client_4.regulatory_compliance_controls @regulatory_compliance_assessments = @client_4.regulatory_compliance_assessments - @server_vulnerability_assessment_operations = @client_4.server_vulnerability_assessment_operations @client_5 = Azure::Security::Mgmt::V2019_01_01::SecurityCenter.new(configurable.credentials, base_url, options) if(@client_5.respond_to?(:subscription_id)) @@ -268,6 +286,22 @@ module Azure::Profiles::Latest @io_tsecurity_solutions_resource_group = @client_6.io_tsecurity_solutions_resource_group @iot_security_solution = @client_6.iot_security_solution + @client_7 = Azure::Security::Mgmt::V2020_01_01::SecurityCenter.new(configurable.credentials, base_url, options) + if(@client_7.respond_to?(:subscription_id)) + @client_7.subscription_id = configurable.subscription_id + end + add_telemetry(@client_7) + @adaptive_network_hardenings = @client_7.adaptive_network_hardenings + @allowed_connections = @client_7.allowed_connections + @adaptive_application_controls = @client_7.adaptive_application_controls + @assessments_metadata = @client_7.assessments_metadata + @assessments = @client_7.assessments + @discovered_security_solutions = @client_7.discovered_security_solutions + @external_security_solutions = @client_7.external_security_solutions + @jit_network_access_policies = @client_7.jit_network_access_policies + @server_vulnerability_assessment_operations = @client_7.server_vulnerability_assessment_operations + @topology = @client_7.topology + @model_classes = ModelClasses.new end @@ -277,7 +311,9 @@ module Azure::Profiles::Latest end def method_missing(method, *args) - if @client_6.respond_to?method + if @client_7.respond_to?method + @client_7.send(method, *args) + elsif @client_6.respond_to?method @client_6.send(method, *args) elsif @client_5.respond_to?method @client_5.send(method, *args) @@ -297,198 +333,30 @@ module Azure::Profiles::Latest end class ModelClasses - def external_security_solution_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionList - end - def rule - Azure::Security::Mgmt::V2015_06_01_preview::Models::Rule - end - def effective_network_security_groups - Azure::Security::Mgmt::V2015_06_01_preview::Models::EffectiveNetworkSecurityGroups - end def security_task_list Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskList end - def adaptive_network_hardenings_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardeningsList - end - def topology_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologyList - end - def adaptive_network_hardening_enforce_request - Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardeningEnforceRequest - end def security_task_parameters Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskParameters end - def topology_resource - Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologyResource - end - def topology_single_resource - Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResource - end - def connected_workspace - Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectedWorkspace - end - def connectable_resource - Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectableResource - end - def aad_solution_properties - Azure::Security::Mgmt::V2015_06_01_preview::Models::AadSolutionProperties - end - def allowed_connections_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::AllowedConnectionsList - end - def topology_single_resource_child - Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResourceChild - end - def app_whitelisting_issue_summary - Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingIssueSummary - end - def external_security_solution_kind1 - Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionKind1 - end - def publisher_info - Azure::Security::Mgmt::V2015_06_01_preview::Models::PublisherInfo - end - def external_security_solution_properties - Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionProperties - end - def path_recommendation - Azure::Security::Mgmt::V2015_06_01_preview::Models::PathRecommendation - end - def aad_connectivity_state1 - Azure::Security::Mgmt::V2015_06_01_preview::Models::AadConnectivityState1 - end - def app_whitelisting_groups - Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingGroups - end - def jit_network_access_port_rule - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPortRule - end - def discovered_security_solution - Azure::Security::Mgmt::V2015_06_01_preview::Models::DiscoveredSecuritySolution - end - def jit_network_access_policy_virtual_machine - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyVirtualMachine - end - def external_security_solution - Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolution - end - def jit_network_access_request_port - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequestPort - end - def jit_network_access_request_virtual_machine - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequestVirtualMachine - end - def topology_single_resource_parent - Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResourceParent - end - def jit_network_access_request - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequest - end - def allowed_connections_resource - Azure::Security::Mgmt::V2015_06_01_preview::Models::AllowedConnectionsResource - end - def jit_network_access_policy - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicy - end - def vm_recommendation - Azure::Security::Mgmt::V2015_06_01_preview::Models::VmRecommendation - end - def jit_network_access_policies_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPoliciesList - end - def app_whitelisting_group - Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingGroup - end - def jit_network_access_policy_initiate_port - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiatePort - end - def discovered_security_solution_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::DiscoveredSecuritySolutionList - end - def jit_network_access_policy_initiate_virtual_machine - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiateVirtualMachine - end - def jit_network_access_policy_initiate_request - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiateRequest - end - def location - Azure::Security::Mgmt::V2015_06_01_preview::Models::Location - end - def kind - Azure::Security::Mgmt::V2015_06_01_preview::Models::Kind - end def app_whitelisting_put_group_data Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingPutGroupData end def asc_location_list Azure::Security::Mgmt::V2015_06_01_preview::Models::AscLocationList end - def connected_resource - Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectedResource - end def operation_display Azure::Security::Mgmt::V2015_06_01_preview::Models::OperationDisplay end def operation_list Azure::Security::Mgmt::V2015_06_01_preview::Models::OperationList end - def user_recommendation - Azure::Security::Mgmt::V2015_06_01_preview::Models::UserRecommendation - end def operation Azure::Security::Mgmt::V2015_06_01_preview::Models::Operation end - def adaptive_network_hardening - Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardening - end - def cef_solution_properties - Azure::Security::Mgmt::V2015_06_01_preview::Models::CefSolutionProperties - end - def cef_external_security_solution - Azure::Security::Mgmt::V2015_06_01_preview::Models::CefExternalSecuritySolution - end - def ata_solution_properties - Azure::Security::Mgmt::V2015_06_01_preview::Models::AtaSolutionProperties - end - def ata_external_security_solution - Azure::Security::Mgmt::V2015_06_01_preview::Models::AtaExternalSecuritySolution - end - def aad_external_security_solution - Azure::Security::Mgmt::V2015_06_01_preview::Models::AadExternalSecuritySolution - end def security_task Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTask end - def direction - Azure::Security::Mgmt::V2015_06_01_preview::Models::Direction - end - def transport_protocol - Azure::Security::Mgmt::V2015_06_01_preview::Models::TransportProtocol - end - def security_family - Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityFamily - end - def aad_connectivity_state - Azure::Security::Mgmt::V2015_06_01_preview::Models::AadConnectivityState - end - def external_security_solution_kind - Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionKind - end - def protocol - Azure::Security::Mgmt::V2015_06_01_preview::Models::Protocol - end - def status - Azure::Security::Mgmt::V2015_06_01_preview::Models::Status - end - def status_reason - Azure::Security::Mgmt::V2015_06_01_preview::Models::StatusReason - end - def connection_type - Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectionType - end def information_protection_keyword Azure::Security::Mgmt::V2017_08_01_preview::Models::InformationProtectionKeyword end @@ -597,9 +465,6 @@ module Azure::Profiles::Latest def regulatory_compliance_standard_list Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceStandardList end - def server_vulnerability_assessments_list - Azure::Security::Mgmt::V2019_01_01_preview::Models::ServerVulnerabilityAssessmentsList - end def regulatory_compliance_standard Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceStandard end @@ -609,9 +474,6 @@ module Azure::Profiles::Latest def regulatory_compliance_assessment Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceAssessment end - def server_vulnerability_assessment - Azure::Security::Mgmt::V2019_01_01_preview::Models::ServerVulnerabilityAssessment - end def state Azure::Security::Mgmt::V2019_01_01_preview::Models::State end @@ -681,9 +543,6 @@ module Azure::Profiles::Latest def io_tsecurity_solution_analytics_model_properties_devices_metrics_item Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem end - def resource - Azure::Security::Mgmt::V2019_08_01::Models::Resource - end def io_tsecurity_device_alerts_list Azure::Security::Mgmt::V2019_08_01::Models::IoTSecurityDeviceAlertsList end @@ -702,9 +561,6 @@ module Azure::Profiles::Latest def io_tsecurity_solution_analytics_model Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionAnalyticsModel end - def asc_location - Azure::Security::Mgmt::V2019_08_01::Models::AscLocation - end def update_iot_security_solution_data Azure::Security::Mgmt::V2019_08_01::Models::UpdateIotSecuritySolutionData end @@ -726,6 +582,258 @@ module Azure::Profiles::Latest def recommendation_config_status Azure::Security::Mgmt::V2019_08_01::Models::RecommendationConfigStatus end + def resource_details + Azure::Security::Mgmt::V2020_01_01::Models::ResourceDetails + end + def rule + Azure::Security::Mgmt::V2020_01_01::Models::Rule + end + def assessment_status + Azure::Security::Mgmt::V2020_01_01::Models::AssessmentStatus + end + def effective_network_security_groups + Azure::Security::Mgmt::V2020_01_01::Models::EffectiveNetworkSecurityGroups + end + def adaptive_network_hardenings_list + Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardeningsList + end + def jit_network_access_policy + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicy + end + def jit_network_access_policy_initiate_port + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiatePort + end + def assessment_links + Azure::Security::Mgmt::V2020_01_01::Models::AssessmentLinks + end + def location + Azure::Security::Mgmt::V2020_01_01::Models::Location + end + def security_assessment_partner_data + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentPartnerData + end + def etag + Azure::Security::Mgmt::V2020_01_01::Models::ETag + end + def topology_list + Azure::Security::Mgmt::V2020_01_01::Models::TopologyList + end + def resource + Azure::Security::Mgmt::V2020_01_01::Models::Resource + end + def security_assessment_list + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentList + end + def connected_resource + Azure::Security::Mgmt::V2020_01_01::Models::ConnectedResource + end + def topology_resource + Azure::Security::Mgmt::V2020_01_01::Models::TopologyResource + end + def allowed_connections_resource + Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsResource + end + def topology_single_resource + Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResource + end + def protection_mode + Azure::Security::Mgmt::V2020_01_01::Models::ProtectionMode + end + def discovered_security_solution + Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolution + end + def vm_recommendation + Azure::Security::Mgmt::V2020_01_01::Models::VmRecommendation + end + def discovered_security_solution_list + Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolutionList + end + def user_recommendation + Azure::Security::Mgmt::V2020_01_01::Models::UserRecommendation + end + def external_security_solution + Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolution + end + def app_whitelisting_group + Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroup + end + def external_security_solution_list + Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionList + end + def security_assessment_metadata_partner_data + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataPartnerData + end + def topology_single_resource_child + Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResourceChild + end + def jit_network_access_policies_list + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList + end + def topology_single_resource_parent + Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResourceParent + end + def adaptive_network_hardening_enforce_request + Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardeningEnforceRequest + end + def server_vulnerability_assessments_list + Azure::Security::Mgmt::V2020_01_01::Models::ServerVulnerabilityAssessmentsList + end + def kind + Azure::Security::Mgmt::V2020_01_01::Models::Kind + end + def jit_network_access_policy_initiate_request + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiateRequest + end + def connected_workspace + Azure::Security::Mgmt::V2020_01_01::Models::ConnectedWorkspace + end + def allowed_connections_list + Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList + end + def aad_solution_properties + Azure::Security::Mgmt::V2020_01_01::Models::AadSolutionProperties + end + def publisher_info + Azure::Security::Mgmt::V2020_01_01::Models::PublisherInfo + end + def jit_network_access_policy_initiate_virtual_machine + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiateVirtualMachine + end + def app_whitelisting_groups + Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroups + end + def external_security_solution_kind1 + Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionKind1 + end + def security_assessment_metadata_list + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataList + end + def external_security_solution_properties + Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionProperties + end + def tags + Azure::Security::Mgmt::V2020_01_01::Models::Tags + end + def aad_connectivity_state1 + Azure::Security::Mgmt::V2020_01_01::Models::AadConnectivityState1 + end + def app_whitelisting_issue_summary + Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingIssueSummary + end + def jit_network_access_port_rule + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPortRule + end + def security_assessment_metadata_properties + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataProperties + end + def jit_network_access_policy_virtual_machine + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyVirtualMachine + end + def connectable_resource + Azure::Security::Mgmt::V2020_01_01::Models::ConnectableResource + end + def jit_network_access_request_port + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequestPort + end + def tracked_resource + Azure::Security::Mgmt::V2020_01_01::Models::TrackedResource + end + def jit_network_access_request_virtual_machine + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequestVirtualMachine + end + def path_recommendation + Azure::Security::Mgmt::V2020_01_01::Models::PathRecommendation + end + def jit_network_access_request + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequest + end + def adaptive_network_hardening + Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardening + end + def asc_location + Azure::Security::Mgmt::V2020_01_01::Models::AscLocation + end + def security_assessment_metadata + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadata + end + def security_assessment + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessment + end + def on_premise_resource_details + Azure::Security::Mgmt::V2020_01_01::Models::OnPremiseResourceDetails + end + def azure_resource_details + Azure::Security::Mgmt::V2020_01_01::Models::AzureResourceDetails + end + def cef_solution_properties + Azure::Security::Mgmt::V2020_01_01::Models::CefSolutionProperties + end + def cef_external_security_solution + Azure::Security::Mgmt::V2020_01_01::Models::CefExternalSecuritySolution + end + def ata_solution_properties + Azure::Security::Mgmt::V2020_01_01::Models::AtaSolutionProperties + end + def ata_external_security_solution + Azure::Security::Mgmt::V2020_01_01::Models::AtaExternalSecuritySolution + end + def aad_external_security_solution + Azure::Security::Mgmt::V2020_01_01::Models::AadExternalSecuritySolution + end + def server_vulnerability_assessment + Azure::Security::Mgmt::V2020_01_01::Models::ServerVulnerabilityAssessment + end + def direction + Azure::Security::Mgmt::V2020_01_01::Models::Direction + end + def transport_protocol + Azure::Security::Mgmt::V2020_01_01::Models::TransportProtocol + end + def category + Azure::Security::Mgmt::V2020_01_01::Models::Category + end + def severity + Azure::Security::Mgmt::V2020_01_01::Models::Severity + end + def user_impact + Azure::Security::Mgmt::V2020_01_01::Models::UserImpact + end + def implementation_effort + Azure::Security::Mgmt::V2020_01_01::Models::ImplementationEffort + end + def threats + Azure::Security::Mgmt::V2020_01_01::Models::Threats + end + def assessment_type + Azure::Security::Mgmt::V2020_01_01::Models::AssessmentType + end + def assessment_status_code + Azure::Security::Mgmt::V2020_01_01::Models::AssessmentStatusCode + end + def security_family + Azure::Security::Mgmt::V2020_01_01::Models::SecurityFamily + end + def aad_connectivity_state + Azure::Security::Mgmt::V2020_01_01::Models::AadConnectivityState + end + def external_security_solution_kind + Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionKind + end + def protocol + Azure::Security::Mgmt::V2020_01_01::Models::Protocol + end + def status + Azure::Security::Mgmt::V2020_01_01::Models::Status + end + def status_reason + Azure::Security::Mgmt::V2020_01_01::Models::StatusReason + end + def connection_type + Azure::Security::Mgmt::V2020_01_01::Models::ConnectionType + end + def expand_enum + Azure::Security::Mgmt::V2020_01_01::Models::ExpandEnum + end end end end diff --git a/config/GEMS_TO_RELEASE b/config/GEMS_TO_RELEASE index c3f3f8e8c..43a7500c7 100644 --- a/config/GEMS_TO_RELEASE +++ b/config/GEMS_TO_RELEASE @@ -1,6 +1,10 @@ { "management": [ - "azure_mgmt_mariadb" + "azure_mgmt_event_grid", + "azure_mgmt_hdinsight", + "azure_mgmt_data_factory", + "azure_mgmt_cosmosdb", + "azure_mgmt_security" ], "rollup": [ "azure_sdk" diff --git a/config/GEM_VERSIONS b/config/GEM_VERSIONS index db18fcf38..011eff27c 100644 --- a/config/GEM_VERSIONS +++ b/config/GEM_VERSIONS @@ -1,6 +1,6 @@ { "rollup": { - "azure_sdk": "0.58.1" + "azure_sdk": "0.59.0" }, "data": { "azure_cognitiveservices_anomalydetector": "0.17.1", @@ -55,7 +55,7 @@ "azure_mgmt_container_instance": "0.17.5", "azure_mgmt_container_registry": "0.18.4", "azure_mgmt_container_service": "0.20.2", - "azure_mgmt_cosmosdb": "0.21.1", + "azure_mgmt_cosmosdb": "0.21.2", "azure_mgmt_cost_management": "0.17.1", "azure_mgmt_customer_insights": "0.17.3", "azure_mgmt_databox": "0.17.1", @@ -63,17 +63,17 @@ "azure_mgmt_datalake_analytics": "0.17.3", "azure_mgmt_datalake_store": "0.17.3", "azure_mgmt_data_migration": "0.18.1", - "azure_mgmt_data_factory": "0.18.2", + "azure_mgmt_data_factory": "0.18.3", "azure_mgmt_deployment_manager": "0.17.1", "azure_mgmt_dev_spaces": "0.17.3", "azure_mgmt_devtestlabs": "0.18.1", "azure_mgmt_dns": "0.17.5", "azure_mgmt_edgegateway": "0.18.1", - "azure_mgmt_event_grid": "0.20.1", + "azure_mgmt_event_grid": "0.20.2", "azure_mgmt_event_hub": "0.18.1", "azure_mgmt_features": "0.17.4", "azure_mgmt_hanaonazure": "0.18.1", - "azure_mgmt_hdinsight": "0.17.8", + "azure_mgmt_hdinsight": "0.18.0", "azure_mgmt_import_export": "0.17.1", "azure_mgmt_iot_central": "0.19.1", "azure_mgmt_iot_hub": "0.17.4", @@ -121,7 +121,7 @@ "azure_mgmt_resources_management": "0.17.2", "azure_mgmt_scheduler": "0.17.2", "azure_mgmt_search": "0.17.3", - "azure_mgmt_security": "0.18.1", + "azure_mgmt_security": "0.18.2", "azure_mgmt_serialconsole": "0.17.1", "azure_mgmt_service_bus": "0.17.4", "azure_mgmt_service_fabric": "0.17.3", diff --git a/config/config.json b/config/config.json index 8ba092808..273a22841 100644 --- a/config/config.json +++ b/config/config.json @@ -735,6 +735,30 @@ ], "namespace": "Azure::Cosmosdb::Mgmt::V2019_08_01_preview", "title": "CosmosDBManagementClient" + }, + "azure_mgmt_cosmosdb_2019_12_12": { + "input-file": [ + "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dd04f70789e293d5931948fa313cf08530fe6c6/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-12-12/cosmos-db.json", + "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dd04f70789e293d5931948fa313cf08530fe6c6/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-12-12/notebook.json" + ], + "namespace": "Azure::Cosmosdb::Mgmt::V2019_12_12", + "title": "CosmosDBManagementClient" + }, + "azure_mgmt_cosmosdb_2020_03_01": { + "input-file": [ + "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dd04f70789e293d5931948fa313cf08530fe6c6/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2020-03-01/cosmos-db.json", + "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dd04f70789e293d5931948fa313cf08530fe6c6/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2020-03-01/notebook.json" + ], + "namespace": "Azure::Cosmosdb::Mgmt::V2020_03_01", + "title": "CosmosDBManagementClient" + }, + "azure_mgmt_cosmosdb_2020_04_01": { + "input-file": [ + "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dd04f70789e293d5931948fa313cf08530fe6c6/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2020-04-01/cosmos-db.json", + "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dd04f70789e293d5931948fa313cf08530fe6c6/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2020-04-01/notebook.json" + ], + "namespace": "Azure::Cosmosdb::Mgmt::V2020_04_01", + "title": "CosmosDBManagementClient" } }, "azure_mgmt_customer_insights": { @@ -821,12 +845,12 @@ }, "azure_mgmt_data_factory": { "azure_mgmt_data_factory_2017_09_01_preview": { - "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/fc9168cb62f513ea9ff88632336f1dc7f5fb9385/specification/datafactory/resource-manager/readme.md", + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dd04f70789e293d5931948fa313cf08530fe6c6/specification/datafactory/resource-manager/readme.md", "namespace": "Azure::DataFactory::Mgmt::V2017_09_01_preview", "tag": "package-2017-09-preview" }, "azure_mgmt_data_factory_2018_06_01": { - "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/28cb8bae84ee6508add21f463c88028ef8148bbe/specification/datafactory/resource-manager/readme.md", + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dd04f70789e293d5931948fa313cf08530fe6c6/specification/datafactory/resource-manager/readme.md", "namespace": "Azure::DataFactory::Mgmt::V2018_06_01", "tag": "package-2018-06" } @@ -892,6 +916,11 @@ } }, "azure_mgmt_event_grid": { + "azure_mgmt_event_grid_2020_06_01": { + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dd04f70789e293d5931948fa313cf08530fe6c6/specification/eventgrid/resource-manager/readme.md", + "namespace": "Azure::EventGrid::Mgmt::V2020_06_01", + "tag": "package-2020-06" + }, "azure_mgmt_event_grid_2020_04_01_preview": { "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/40e12023460046fc431382c86e0a99e85e30bfe6/specification/eventgrid/resource-manager/readme.md", "namespace": "Azure::EventGrid::Mgmt::V2020_04_01_preview", @@ -981,12 +1010,12 @@ }, "azure_mgmt_hdinsight": { "azure_mgmt_hdinsight_2015_03_01_preview": { - "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/aef7bda78247cfb37c0c46516824b65a04f1707c/specification/hdinsight/resource-manager/readme.md", + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dd04f70789e293d5931948fa313cf08530fe6c6/specification/hdinsight/resource-manager/readme.md", "namespace": "Azure::Hdinsight::Mgmt::V2015_03_01_preview", "tag": "package-2015-03-preview" }, "azure_mgmt_hdinsight_2018_06_01_preview": { - "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/aef7bda78247cfb37c0c46516824b65a04f1707c/specification/hdinsight/resource-manager/readme.md", + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dd04f70789e293d5931948fa313cf08530fe6c6/specification/hdinsight/resource-manager/readme.md", "namespace": "Azure::Hdinsight::Mgmt::V2018_06_01_preview", "tag": "package-2018-06-preview" } @@ -2753,6 +2782,18 @@ "namespace": "Azure::Security::Mgmt::V2019_08_01", "title": "SecurityManagementClient", "tag": "package-2019-08-only" + }, + "azure_mgmt_security_2020_01_01": { + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/4f5762bcf9c0ba570d0d99f3cd461b02a037f10c/specification/security/resource-manager/readme.md", + "namespace": "Azure::Security::Mgmt::V2020_01_01", + "title": "SecurityManagementClient", + "tag": "package-2020-01-only" + }, + "azure_mgmt_security_2020_01_01_preview": { + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/4f5762bcf9c0ba570d0d99f3cd461b02a037f10c/specification/security/resource-manager/readme.md", + "namespace": "Azure::Security::Mgmt::V2020_01_01_preview", + "title": "SecurityManagementClient", + "tag": "package-2020-01-preview-only" } }, "azure_mgmt_serialconsole": { diff --git a/config/profiles.json b/config/profiles.json index 776da88b2..e00ecc178 100644 --- a/config/profiles.json +++ b/config/profiles.json @@ -411,7 +411,7 @@ }, "Microsoft.EventGrid": { "management": { - "2020-04-01-preview": ["*"] + "2020-06-01": ["*"] }, "data": { "2018-01-01": ["*"] @@ -710,7 +710,8 @@ "2018-06-01": ["*"], "2019-01-01-preview": ["*"], "2019-01-01": ["*"], - "2019-08-01": ["*"] + "2019-08-01": ["*"], + "2020-01-01": ["*"] } }, "Microsoft.Serialconsole": { @@ -1575,7 +1576,7 @@ "resourceTypes": { "Microsoft.EventGrid" : { "management": { - "2020-04-01-preview": ["*"] + "2020-06-01": ["*"] } } }, @@ -2551,7 +2552,8 @@ "2018-06-01": ["*"], "2019-01-01-preview": ["*"], "2019-01-01": ["*"], - "2019-08-01": ["*"] + "2019-08-01": ["*"], + "2020-01-01": ["*"] } } }, diff --git a/management/azure_mgmt_cosmosdb/lib/2015-04-08/generated/azure_mgmt_cosmosdb/cosmos_db.rb b/management/azure_mgmt_cosmosdb/lib/2015-04-08/generated/azure_mgmt_cosmosdb/cosmos_db.rb index b757fdf05..1a141ef33 100644 --- a/management/azure_mgmt_cosmosdb/lib/2015-04-08/generated/azure_mgmt_cosmosdb/cosmos_db.rb +++ b/management/azure_mgmt_cosmosdb/lib/2015-04-08/generated/azure_mgmt_cosmosdb/cosmos_db.rb @@ -173,7 +173,7 @@ module Azure::Cosmosdb::Mgmt::V2015_04_08 # def add_telemetry sdk_information = 'azure_mgmt_cosmosdb' - sdk_information = "#{sdk_information}/0.21.1" + sdk_information = "#{sdk_information}/0.21.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb b/management/azure_mgmt_cosmosdb/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb index c5b20709a..fc5c5f10a 100644 --- a/management/azure_mgmt_cosmosdb/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +++ b/management/azure_mgmt_cosmosdb/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb @@ -135,7 +135,7 @@ module Azure::Cosmosdb::Mgmt::V2019_08_01_preview # def add_telemetry sdk_information = 'azure_mgmt_cosmosdb' - sdk_information = "#{sdk_information}/0.21.1" + sdk_information = "#{sdk_information}/0.21.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-08-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb b/management/azure_mgmt_cosmosdb/lib/2019-08-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb index 63d5bcaf4..178edd99a 100644 --- a/management/azure_mgmt_cosmosdb/lib/2019-08-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +++ b/management/azure_mgmt_cosmosdb/lib/2019-08-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb @@ -193,7 +193,7 @@ module Azure::Cosmosdb::Mgmt::V2019_08_01 # def add_telemetry sdk_information = 'azure_mgmt_cosmosdb' - sdk_information = "#{sdk_information}/0.21.1" + sdk_information = "#{sdk_information}/0.21.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb.rb new file mode 100644 index 000000000..36c6ac7d1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb.rb @@ -0,0 +1,190 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require '2019-12-12/generated/azure_mgmt_cosmosdb/module_definition' +require 'ms_rest_azure' + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + autoload :DatabaseAccounts, '2019-12-12/generated/azure_mgmt_cosmosdb/database_accounts.rb' + autoload :Operations, '2019-12-12/generated/azure_mgmt_cosmosdb/operations.rb' + autoload :Database, '2019-12-12/generated/azure_mgmt_cosmosdb/database.rb' + autoload :Collection, '2019-12-12/generated/azure_mgmt_cosmosdb/collection.rb' + autoload :CollectionRegion, '2019-12-12/generated/azure_mgmt_cosmosdb/collection_region.rb' + autoload :DatabaseAccountRegion, '2019-12-12/generated/azure_mgmt_cosmosdb/database_account_region.rb' + autoload :PercentileSourceTarget, '2019-12-12/generated/azure_mgmt_cosmosdb/percentile_source_target.rb' + autoload :PercentileTarget, '2019-12-12/generated/azure_mgmt_cosmosdb/percentile_target.rb' + autoload :Percentile, '2019-12-12/generated/azure_mgmt_cosmosdb/percentile.rb' + autoload :CollectionPartitionRegion, '2019-12-12/generated/azure_mgmt_cosmosdb/collection_partition_region.rb' + autoload :CollectionPartition, '2019-12-12/generated/azure_mgmt_cosmosdb/collection_partition.rb' + autoload :PartitionKeyRangeId, '2019-12-12/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb' + autoload :PartitionKeyRangeIdRegion, '2019-12-12/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb' + autoload :SqlResources, '2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb' + autoload :MongoDBResources, '2019-12-12/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb' + autoload :TableResources, '2019-12-12/generated/azure_mgmt_cosmosdb/table_resources.rb' + autoload :CassandraResources, '2019-12-12/generated/azure_mgmt_cosmosdb/cassandra_resources.rb' + autoload :GremlinResources, '2019-12-12/generated/azure_mgmt_cosmosdb/gremlin_resources.rb' + autoload :NotebookWorkspaces, '2019-12-12/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb' + autoload :CosmosDBManagementClient, '2019-12-12/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb' + + module Models + autoload :ARMProxyResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb' + autoload :ConsistencyPolicy, '2019-12-12/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb' + autoload :ExtendedResourceProperties, '2019-12-12/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb' + autoload :Location, '2019-12-12/generated/azure_mgmt_cosmosdb/models/location.rb' + autoload :ThroughputPolicyResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb' + autoload :VirtualNetworkRule, '2019-12-12/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb' + autoload :AutoUpgradePolicyResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb' + autoload :DatabaseAccountsListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb' + autoload :ProvisionedThroughputSettingsResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/provisioned_throughput_settings_resource.rb' + autoload :MetricValue, '2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_value.rb' + autoload :SqlDatabaseListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb' + autoload :CassandraTableListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb' + autoload :IncludedPath, '2019-12-12/generated/azure_mgmt_cosmosdb/models/included_path.rb' + autoload :GremlinDatabaseGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb' + autoload :CompositePath, '2019-12-12/generated/azure_mgmt_cosmosdb/models/composite_path.rb' + autoload :MetricDefinitionsListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb' + autoload :IndexingPolicy, '2019-12-12/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb' + autoload :GremlinDatabaseListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb' + autoload :UniqueKey, '2019-12-12/generated/azure_mgmt_cosmosdb/models/unique_key.rb' + autoload :GremlinGraphGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb' + autoload :ConflictResolutionPolicy, '2019-12-12/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb' + autoload :MetricDefinition, '2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_definition.rb' + autoload :GremlinGraphListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb' + autoload :SqlStoredProcedureGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb' + autoload :ErrorResponse, '2019-12-12/generated/azure_mgmt_cosmosdb/models/error_response.rb' + autoload :SqlStoredProcedureListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb' + autoload :FailoverPolicies, '2019-12-12/generated/azure_mgmt_cosmosdb/models/failover_policies.rb' + autoload :NotebookWorkspaceListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb' + autoload :RegionForOnlineOffline, '2019-12-12/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb' + autoload :SqlTriggerGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb' + autoload :ARMResourceProperties, '2019-12-12/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb' + autoload :SqlTriggerListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb' + autoload :Capability, '2019-12-12/generated/azure_mgmt_cosmosdb/models/capability.rb' + autoload :PercentileMetricListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb' + autoload :FailoverPolicy, '2019-12-12/generated/azure_mgmt_cosmosdb/models/failover_policy.rb' + autoload :MongoIndexKeys, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb' + autoload :MongoIndexOptions, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb' + autoload :TableResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/table_resource.rb' + autoload :MongoDBCollectionGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb' + autoload :SqlDatabaseGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb' + autoload :MongoDBCollectionListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb' + autoload :MetricAvailability, '2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_availability.rb' + autoload :MetricListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb' + autoload :ThroughputSettingsGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb' + autoload :CassandraKeyspaceGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb' + autoload :PartitionUsagesResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb' + autoload :CassandraKeyspaceListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb' + autoload :UsagesResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/usages_result.rb' + autoload :CassandraPartitionKey, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb' + autoload :DatabaseAccountUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb' + autoload :CassandraSchema, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb' + autoload :DatabaseAccountListReadOnlyKeysResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb' + autoload :Indexes, '2019-12-12/generated/azure_mgmt_cosmosdb/models/indexes.rb' + autoload :Usage, '2019-12-12/generated/azure_mgmt_cosmosdb/models/usage.rb' + autoload :SpatialSpec, '2019-12-12/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb' + autoload :DatabaseAccountConnectionString, '2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb' + autoload :UniqueKeyPolicy, '2019-12-12/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb' + autoload :DatabaseAccountListConnectionStringsResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb' + autoload :SqlContainerListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb' + autoload :DatabaseAccountRegenerateKeyParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb' + autoload :SqlUserDefinedFunctionGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb' + autoload :ThroughputSettingsResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb' + autoload :PartitionMetricListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb' + autoload :MetricName, '2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_name.rb' + autoload :MongoDBDatabaseListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb' + autoload :SqlDatabaseResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb' + autoload :PercentileMetric, '2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb' + autoload :CreateUpdateOptions, '2019-12-12/generated/azure_mgmt_cosmosdb/models/create_update_options.rb' + autoload :TableListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/table_list_result.rb' + autoload :OperationListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb' + autoload :Column, '2019-12-12/generated/azure_mgmt_cosmosdb/models/column.rb' + autoload :SqlContainerResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb' + autoload :CassandraTableGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb' + autoload :Operation, '2019-12-12/generated/azure_mgmt_cosmosdb/models/operation.rb' + autoload :ContainerPartitionKey, '2019-12-12/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb' + autoload :SqlStoredProcedureResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb' + autoload :NotebookWorkspaceConnectionInfoResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb' + autoload :OperationDisplay, '2019-12-12/generated/azure_mgmt_cosmosdb/models/operation_display.rb' + autoload :MongoDBDatabaseGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb' + autoload :SqlUserDefinedFunctionResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb' + autoload :TableGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb' + autoload :GremlinGraphResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb' + autoload :ClusterKey, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cluster_key.rb' + autoload :SqlTriggerResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb' + autoload :SqlContainerGetPropertiesResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb' + autoload :GremlinDatabaseResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb' + autoload :MongoIndex, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index.rb' + autoload :MongoDBDatabaseResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb' + autoload :ExcludedPath, '2019-12-12/generated/azure_mgmt_cosmosdb/models/excluded_path.rb' + autoload :CassandraTableResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb' + autoload :Metric, '2019-12-12/generated/azure_mgmt_cosmosdb/models/metric.rb' + autoload :MongoDBCollectionResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb' + autoload :SqlUserDefinedFunctionListResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb' + autoload :CassandraKeyspaceResource, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb' + autoload :DatabaseAccountGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb' + autoload :SqlDatabaseGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb' + autoload :SqlContainerGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb' + autoload :SqlStoredProcedureGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb' + autoload :SqlUserDefinedFunctionGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb' + autoload :SqlTriggerGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb' + autoload :MongoDBDatabaseGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb' + autoload :MongoDBCollectionGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb' + autoload :TableGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/table_get_results.rb' + autoload :CassandraKeyspaceGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb' + autoload :CassandraTableGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb' + autoload :GremlinDatabaseGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb' + autoload :GremlinGraphGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb' + autoload :ThroughputSettingsGetResults, '2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb' + autoload :DatabaseAccountCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb' + autoload :DatabaseAccountListKeysResult, '2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb' + autoload :ThroughputSettingsUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb' + autoload :SqlDatabaseCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb' + autoload :SqlContainerCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb' + autoload :SqlStoredProcedureCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb' + autoload :SqlUserDefinedFunctionCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb' + autoload :SqlTriggerCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb' + autoload :MongoDBDatabaseCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb' + autoload :MongoDBCollectionCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb' + autoload :TableCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb' + autoload :CassandraKeyspaceCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb' + autoload :CassandraTableCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb' + autoload :GremlinDatabaseCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb' + autoload :GremlinGraphCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb' + autoload :PartitionUsage, '2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_usage.rb' + autoload :PercentileMetricValue, '2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb' + autoload :PartitionMetric, '2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_metric.rb' + autoload :NotebookWorkspaceCreateUpdateParameters, '2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb' + autoload :NotebookWorkspace, '2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb' + autoload :DatabaseAccountKind, '2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb' + autoload :DatabaseAccountOfferType, '2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb' + autoload :DefaultConsistencyLevel, '2019-12-12/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb' + autoload :ConnectorOffer, '2019-12-12/generated/azure_mgmt_cosmosdb/models/connector_offer.rb' + autoload :IndexingMode, '2019-12-12/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb' + autoload :DataType, '2019-12-12/generated/azure_mgmt_cosmosdb/models/data_type.rb' + autoload :IndexKind, '2019-12-12/generated/azure_mgmt_cosmosdb/models/index_kind.rb' + autoload :CompositePathSortOrder, '2019-12-12/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb' + autoload :SpatialType, '2019-12-12/generated/azure_mgmt_cosmosdb/models/spatial_type.rb' + autoload :PartitionKind, '2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_kind.rb' + autoload :ConflictResolutionMode, '2019-12-12/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb' + autoload :TriggerType, '2019-12-12/generated/azure_mgmt_cosmosdb/models/trigger_type.rb' + autoload :TriggerOperation, '2019-12-12/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb' + autoload :KeyKind, '2019-12-12/generated/azure_mgmt_cosmosdb/models/key_kind.rb' + autoload :UnitType, '2019-12-12/generated/azure_mgmt_cosmosdb/models/unit_type.rb' + autoload :PrimaryAggregationType, '2019-12-12/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb' + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/cassandra_resources.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/cassandra_resources.rb new file mode 100644 index 000000000..8583bc730 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/cassandra_resources.rb @@ -0,0 +1,1628 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CassandraResources + include MsRestAzure + + # + # Creates and initializes a new instance of the CassandraResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceListResult] operation results. + # + def list_cassandra_keyspaces(resource_group_name, account_name, custom_headers:nil) + response = list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_cassandra_keyspaces_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::CassandraKeyspaceListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceGetResults] operation results. + # + def get_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::CassandraKeyspaceGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceGetResults] operation results. + # + def create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + response = create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::CassandraKeyspaceGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + # Send request + promise = begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Cassandra Keyspace under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Cassandra Keyspace under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Cassandra Keyspace under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + response = update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableListResult] operation results. + # + def list_cassandra_tables(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_cassandra_tables_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Lists the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::CassandraTableListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableGetResults] operation results. + # + def get_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::CassandraTableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableGetResults] operation results. + # + def create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + response = create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::CassandraTableGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + # Send request + promise = begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos + # DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos + # DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos + # DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + response = update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceGetResults] operation results. + # + def begin_create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + response = begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_cassandra_keyspace_parameters is nil' if create_update_cassandra_keyspace_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::CassandraKeyspaceCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_cassandra_keyspace_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::CassandraKeyspaceGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableGetResults] operation results. + # + def begin_create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + response = begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_cassandra_table_parameters is nil' if create_update_cassandra_table_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::CassandraTableCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_cassandra_table_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::CassandraTableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection.rb new file mode 100644 index 000000000..d78b61167 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection.rb @@ -0,0 +1,374 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Collection + include MsRestAzure + + # + # Creates and initializes a new instance of the Collection class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account and collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent storage data) for the given collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent storage data) for the given collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent storage data) for the given collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::UsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves metric definitions for the given collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricDefinitionsListResult] operation results. + # + def list_metric_definitions(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil) + response = list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves metric definitions for the given collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metric_definitions_with_http_info(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil) + list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:custom_headers).value! + end + + # + # Retrieves metric definitions for the given collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MetricDefinitionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_partition.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_partition.rb new file mode 100644 index 000000000..99a4a0853 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_partition.rb @@ -0,0 +1,269 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CollectionPartition + include MsRestAzure + + # + # Creates and initializes a new instance of the CollectionPartition class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given + # collection, split by partition. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given + # collection, split by partition. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given + # collection, split by partition. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent storage data) for the given collection, + # split by partition. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionUsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent storage data) for the given collection, + # split by partition. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent storage data) for the given collection, + # split by partition. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::PartitionUsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_partition_region.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_partition_region.rb new file mode 100644 index 000000000..0e5eae34c --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_partition_region.rb @@ -0,0 +1,156 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CollectionPartitionRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the CollectionPartitionRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given collection + # and region, split by partition. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given collection + # and region, split by partition. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given collection + # and region, split by partition. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_region.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_region.rb new file mode 100644 index 000000000..a66fd4e47 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/collection_region.rb @@ -0,0 +1,156 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CollectionRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the CollectionRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account, collection and region. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account, collection and region. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account, collection and region. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb new file mode 100644 index 000000000..7aa860fa6 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb @@ -0,0 +1,210 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # A service client - single point of access to the REST API. + # + class CosmosDBManagementClient < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] Azure subscription ID. + attr_accessor :subscription_id + + # @return [String] Version of the API to be used with the client request. + # The current version is 2019-08-01. + attr_reader :api_version + + # @return [String] The API version to use for this operation. + attr_accessor :api_version1 + + # @return [String] The ID of the target subscription. + attr_accessor :subscription_id1 + + # @return [String] The preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] The retry timeout in seconds for Long Running + # Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] Whether a unique x-ms-client-request-id should be + # generated. When set to true a unique x-ms-client-request-id value is + # generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [DatabaseAccounts] database_accounts + attr_reader :database_accounts + + # @return [Operations] operations + attr_reader :operations + + # @return [Database] database + attr_reader :database + + # @return [Collection] collection + attr_reader :collection + + # @return [CollectionRegion] collection_region + attr_reader :collection_region + + # @return [DatabaseAccountRegion] database_account_region + attr_reader :database_account_region + + # @return [PercentileSourceTarget] percentile_source_target + attr_reader :percentile_source_target + + # @return [PercentileTarget] percentile_target + attr_reader :percentile_target + + # @return [Percentile] percentile + attr_reader :percentile + + # @return [CollectionPartitionRegion] collection_partition_region + attr_reader :collection_partition_region + + # @return [CollectionPartition] collection_partition + attr_reader :collection_partition + + # @return [PartitionKeyRangeId] partition_key_range_id + attr_reader :partition_key_range_id + + # @return [PartitionKeyRangeIdRegion] partition_key_range_id_region + attr_reader :partition_key_range_id_region + + # @return [SqlResources] sql_resources + attr_reader :sql_resources + + # @return [MongoDBResources] mongo_dbresources + attr_reader :mongo_dbresources + + # @return [TableResources] table_resources + attr_reader :table_resources + + # @return [CassandraResources] cassandra_resources + attr_reader :cassandra_resources + + # @return [GremlinResources] gremlin_resources + attr_reader :gremlin_resources + + # @return [NotebookWorkspaces] notebook_workspaces + attr_reader :notebook_workspaces + + # + # Creates initializes a new instance of the CosmosDBManagementClient class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @database_accounts = DatabaseAccounts.new(self) + @operations = Operations.new(self) + @database = Database.new(self) + @collection = Collection.new(self) + @collection_region = CollectionRegion.new(self) + @database_account_region = DatabaseAccountRegion.new(self) + @percentile_source_target = PercentileSourceTarget.new(self) + @percentile_target = PercentileTarget.new(self) + @percentile = Percentile.new(self) + @collection_partition_region = CollectionPartitionRegion.new(self) + @collection_partition = CollectionPartition.new(self) + @partition_key_range_id = PartitionKeyRangeId.new(self) + @partition_key_range_id_region = PartitionKeyRangeIdRegion.new(self) + @sql_resources = SqlResources.new(self) + @mongo_dbresources = MongoDBResources.new(self) + @table_resources = TableResources.new(self) + @cassandra_resources = CassandraResources.new(self) + @gremlin_resources = GremlinResources.new(self) + @notebook_workspaces = NotebookWorkspaces.new(self) + @api_version = '2019-12-12' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) + @request_headers['Content-Type'] = options[:headers]['Content-Type'] + end + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_cosmosdb' + sdk_information = "#{sdk_information}/0.21.2" + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database.rb new file mode 100644 index 000000000..f9c6fe035 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database.rb @@ -0,0 +1,362 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Database + include MsRestAzure + + # + # Creates and initializes a new instance of the Database class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account and database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent data) for the given database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, database_rid, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, database_rid, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent data) for the given database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, database_rid, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, database_rid, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent data) for the given database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, database_rid, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::UsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves metric definitions for the given database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricDefinitionsListResult] operation results. + # + def list_metric_definitions(resource_group_name, account_name, database_rid, custom_headers:nil) + response = list_metric_definitions_async(resource_group_name, account_name, database_rid, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves metric definitions for the given database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metric_definitions_with_http_info(resource_group_name, account_name, database_rid, custom_headers:nil) + list_metric_definitions_async(resource_group_name, account_name, database_rid, custom_headers:custom_headers).value! + end + + # + # Retrieves metric definitions for the given database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metric_definitions_async(resource_group_name, account_name, database_rid, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MetricDefinitionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database_account_region.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database_account_region.rb new file mode 100644 index 000000000..7ccf18f7a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database_account_region.rb @@ -0,0 +1,148 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class DatabaseAccountRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the DatabaseAccountRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account and region. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and region. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and region. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database_accounts.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database_accounts.rb new file mode 100644 index 000000000..da534a72e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/database_accounts.rb @@ -0,0 +1,2184 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class DatabaseAccounts + include MsRestAzure + + # + # Creates and initializes a new instance of the DatabaseAccounts class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def get(resource_group_name, account_name, custom_headers:nil) + response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, account_name, custom_headers:nil) + get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Retrieves the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def update(resource_group_name, account_name, update_parameters, custom_headers:nil) + response = update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, account_name, update_parameters, custom_headers:nil) + # Send request + promise = begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def create_or_update(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + response = create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, account_name, custom_headers:nil) + response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def failover_priority_change(resource_group_name, account_name, failover_parameters, custom_headers:nil) + response = failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:nil) + # Send request + promise = begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists all the Azure Cosmos DB database accounts available under the + # subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountsListResult] operation results. + # + def list(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all the Azure Cosmos DB database accounts available under the + # subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Lists all the Azure Cosmos DB database accounts available under the + # subscription. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all the Azure Cosmos DB database accounts available under the given + # resource group. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountsListResult] operation results. + # + def list_by_resource_group(resource_group_name, custom_headers:nil) + response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all the Azure Cosmos DB database accounts available under the given + # resource group. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil) + list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! + end + + # + # Lists all the Azure Cosmos DB database accounts available under the given + # resource group. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, custom_headers:nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists the access keys for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListKeysResult] operation results. + # + def list_keys(resource_group_name, account_name, custom_headers:nil) + response = list_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the access keys for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the access keys for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_keys_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountListKeysResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists the connection strings for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListConnectionStringsResult] operation results. + # + def list_connection_strings(resource_group_name, account_name, custom_headers:nil) + response = list_connection_strings_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the connection strings for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_connection_strings_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_connection_strings_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the connection strings for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_connection_strings_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountListConnectionStringsResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def offline_region(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + response = offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + # Send request + promise = begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def online_region(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + response = online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + # Send request + promise = begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListReadOnlyKeysResult] operation results. + # + def get_read_only_keys(resource_group_name, account_name, custom_headers:nil) + response = get_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_read_only_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) + get_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_read_only_keys_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountListReadOnlyKeysResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListReadOnlyKeysResult] operation results. + # + def list_read_only_keys(resource_group_name, account_name, custom_headers:nil) + response = list_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_read_only_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_read_only_keys_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountListReadOnlyKeysResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def regenerate_key(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + response = regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + # Send request + promise = begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Checks that the Azure Cosmos DB account name already exists. A valid account + # name may contain only lowercase letters, numbers, and the '-' character, and + # must be between 3 and 50 characters. + # + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Boolean] operation results. + # + def check_name_exists(account_name, custom_headers:nil) + response = check_name_exists_async(account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Checks that the Azure Cosmos DB account name already exists. A valid account + # name may contain only lowercase letters, numbers, and the '-' character, and + # must be between 3 and 50 characters. + # + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def check_name_exists_with_http_info(account_name, custom_headers:nil) + check_name_exists_async(account_name, custom_headers:custom_headers).value! + end + + # + # Checks that the Azure Cosmos DB account name already exists. A valid account + # name may contain only lowercase letters, numbers, and the '-' character, and + # must be between 3 and 50 characters. + # + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def check_name_exists_async(account_name, custom_headers:nil) + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:head, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 404 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.body = (status_code == 200) + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent data) for the given database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent data) for the given database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent data) for the given database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::UsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves metric definitions for the given database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricDefinitionsListResult] operation results. + # + def list_metric_definitions(resource_group_name, account_name, custom_headers:nil) + response = list_metric_definitions_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves metric definitions for the given database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metric_definitions_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_metric_definitions_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Retrieves metric definitions for the given database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metric_definitions_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MetricDefinitionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def begin_update(resource_group_name, account_name, update_parameters, custom_headers:nil) + response = begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, account_name, update_parameters, custom_headers:nil) + begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'update_parameters is nil' if update_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def begin_create_or_update(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_parameters is nil' if create_update_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, account_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_failover_priority_change(resource_group_name, account_name, failover_parameters, custom_headers:nil) + response = begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! + nil + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_failover_priority_change_with_http_info(resource_group_name, account_name, failover_parameters, custom_headers:nil) + begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'failover_parameters is nil' if failover_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::FailoverPolicies.mapper() + request_content = @client.serialize(request_mapper, failover_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_offline_region(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + response = begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! + nil + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_offline_region_with_http_info(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'region_parameter_for_offline is nil' if region_parameter_for_offline.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::RegionForOnlineOffline.mapper() + request_content = @client.serialize(request_mapper, region_parameter_for_offline) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_online_region(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + response = begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! + nil + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_online_region_with_http_info(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'region_parameter_for_online is nil' if region_parameter_for_online.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::RegionForOnlineOffline.mapper() + request_content = @client.serialize(request_mapper, region_parameter_for_online) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_regenerate_key(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + response = begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! + nil + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_regenerate_key_with_http_info(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'key_to_regenerate is nil' if key_to_regenerate.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::DatabaseAccountRegenerateKeyParameters.mapper() + request_content = @client.serialize(request_mapper, key_to_regenerate) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/gremlin_resources.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/gremlin_resources.rb new file mode 100644 index 000000000..2ca83ce2e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/gremlin_resources.rb @@ -0,0 +1,1623 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class GremlinResources + include MsRestAzure + + # + # Creates and initializes a new instance of the GremlinResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the Gremlin databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseListResult] operation results. + # + def list_gremlin_databases(resource_group_name, account_name, custom_headers:nil) + response = list_gremlin_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Gremlin databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_gremlin_databases_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_gremlin_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the Gremlin databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_gremlin_databases_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::GremlinDatabaseListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Gremlin databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseGetResults] operation results. + # + def get_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Gremlin databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the Gremlin databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::GremlinDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseGetResults] operation results. + # + def create_update_gremlin_database(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + response = create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::GremlinDatabaseGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + # Send request + promise = begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Gremlin database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_gremlin_database_throughput(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Gremlin database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_database_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Gremlin database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_gremlin_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphListResult] operation results. + # + def list_gremlin_graphs(resource_group_name, account_name, database_name, custom_headers:nil) + response = list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_gremlin_graphs_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Lists the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::GremlinGraphListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphGetResults] operation results. + # + def get_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + end + + # + # Gets the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::GremlinGraphGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphGetResults] operation results. + # + def create_update_gremlin_graph(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + response = create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::GremlinGraphGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + # Send request + promise = begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_graph_throughput_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + end + + # + # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + response = update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseGetResults] operation results. + # + def begin_create_update_gremlin_database(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + response = begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_gremlin_database_with_http_info(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_gremlin_database_parameters is nil' if create_update_gremlin_database_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::GremlinDatabaseCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_gremlin_database_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::GremlinDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_gremlin_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_gremlin_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_gremlin_database_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphGetResults] operation results. + # + def begin_create_update_gremlin_graph(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + response = begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_gremlin_graph_parameters is nil' if create_update_gremlin_graph_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::GremlinGraphCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_gremlin_graph_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::GremlinGraphGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_gremlin_graph_throughput_with_http_info(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb new file mode 100644 index 000000000..7f1d3c6e7 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The resource model definition for a ARM proxy resource. It will have + # everything other than required location and tags + # + class ARMProxyResource + + include MsRestAzure + + # @return [String] The unique resource identifier of the database + # account. + attr_accessor :id + + # @return [String] The name of the database account. + attr_accessor :name + + # @return [String] The type of Azure resource. + attr_accessor :type + + + # + # Mapper for ARMProxyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ARMProxyResource', + type: { + name: 'Composite', + class_name: 'ARMProxyResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb new file mode 100644 index 000000000..224a8df28 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb @@ -0,0 +1,102 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The core properties of ARM resources. + # + class ARMResourceProperties + + include MsRestAzure + + # @return [String] The unique resource identifier of the ARM resource. + attr_accessor :id + + # @return [String] The name of the ARM resource. + attr_accessor :name + + # @return [String] The type of Azure resource. + attr_accessor :type + + # @return [String] The location of the resource group to which the + # resource belongs. + attr_accessor :location + + # @return [Hash{String => String}] + attr_accessor :tags + + + # + # Mapper for ARMResourceProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ARMResourceProperties', + type: { + name: 'Composite', + class_name: 'ARMResourceProperties', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb new file mode 100644 index 000000000..401dc954b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB resource auto-upgrade policy + # + class AutoUpgradePolicyResource + + include MsRestAzure + + # @return [ThroughputPolicyResource] Represents throughput policy which + # service must adhere to for auto-upgrade + attr_accessor :throughput_policy + + + # + # Mapper for AutoUpgradePolicyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AutoUpgradePolicyResource', + type: { + name: 'Composite', + class_name: 'AutoUpgradePolicyResource', + model_properties: { + throughput_policy: { + client_side_validation: true, + required: false, + serialized_name: 'throughputPolicy', + type: { + name: 'Composite', + class_name: 'ThroughputPolicyResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/capability.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/capability.rb new file mode 100644 index 000000000..6e25b0907 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/capability.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB capability object + # + class Capability + + include MsRestAzure + + # @return [String] Name of the Cosmos DB capability. For example, "name": + # "EnableCassandra". Current values also include "EnableTable" and + # "EnableGremlin". + attr_accessor :name + + + # + # Mapper for Capability class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Capability', + type: { + name: 'Composite', + class_name: 'Capability', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb new file mode 100644 index 000000000..8ddd8c962 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB Cassandra keyspace. + # + class CassandraKeyspaceCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraKeyspaceResource] The standard JSON format of a + # Cassandra keyspace + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for CassandraKeyspaceCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb new file mode 100644 index 000000000..359549021 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class CassandraKeyspaceGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra keyspace + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for CassandraKeyspaceGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceGetProperties_resource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb new file mode 100644 index 000000000..d14bd5e9b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB Cassandra keyspace. + # + class CassandraKeyspaceGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraKeyspaceGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for CassandraKeyspaceGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceGetResults', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb new file mode 100644 index 000000000..bc2d93b54 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the Cassandra keyspaces and + # their properties. + # + class CassandraKeyspaceListResult + + include MsRestAzure + + # @return [Array] List of Cassandra + # keyspaces and their properties. + attr_accessor :value + + + # + # Mapper for CassandraKeyspaceListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceListResult', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceGetResultsElementType', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb new file mode 100644 index 000000000..868aa06b2 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB Cassandra keyspace resource object + # + class CassandraKeyspaceResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra keyspace + attr_accessor :id + + + # + # Mapper for CassandraKeyspaceResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceResource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb new file mode 100644 index 000000000..d6ba47118 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB Cassandra table partition key + # + class CassandraPartitionKey + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table partition key + attr_accessor :name + + + # + # Mapper for CassandraPartitionKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraPartitionKey', + type: { + name: 'Composite', + class_name: 'CassandraPartitionKey', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb new file mode 100644 index 000000000..85a434182 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb @@ -0,0 +1,95 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB Cassandra table schema + # + class CassandraSchema + + include MsRestAzure + + # @return [Array] List of Cassandra table columns. + attr_accessor :columns + + # @return [Array] List of partition key. + attr_accessor :partition_keys + + # @return [Array] List of cluster key. + attr_accessor :cluster_keys + + + # + # Mapper for CassandraSchema class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraSchema', + type: { + name: 'Composite', + class_name: 'CassandraSchema', + model_properties: { + columns: { + client_side_validation: true, + required: false, + serialized_name: 'columns', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ColumnElementType', + type: { + name: 'Composite', + class_name: 'Column' + } + } + } + }, + partition_keys: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKeys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CassandraPartitionKeyElementType', + type: { + name: 'Composite', + class_name: 'CassandraPartitionKey' + } + } + } + }, + cluster_keys: { + client_side_validation: true, + required: false, + serialized_name: 'clusterKeys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ClusterKeyElementType', + type: { + name: 'Composite', + class_name: 'ClusterKey' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb new file mode 100644 index 000000000..6f4e5b390 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB Cassandra table. + # + class CassandraTableCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraTableResource] The standard JSON format of a + # Cassandra table + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for CassandraTableCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'CassandraTableCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraTableResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb new file mode 100644 index 000000000..d8252f590 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb @@ -0,0 +1,108 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class CassandraTableGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table + attr_accessor :id + + # @return [Integer] Time to live of the Cosmos DB Cassandra table + attr_accessor :default_ttl + + # @return [CassandraSchema] Schema of the Cosmos DB Cassandra table + attr_accessor :schema + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for CassandraTableGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableGetProperties_resource', + type: { + name: 'Composite', + class_name: 'CassandraTableGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + schema: { + client_side_validation: true, + required: false, + serialized_name: 'schema', + type: { + name: 'Composite', + class_name: 'CassandraSchema' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb new file mode 100644 index 000000000..8e6678af8 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB Cassandra table. + # + class CassandraTableGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraTableGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for CassandraTableGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableGetResults', + type: { + name: 'Composite', + class_name: 'CassandraTableGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraTableGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb new file mode 100644 index 000000000..d4064c4cb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the Cassandra tables and their + # properties. + # + class CassandraTableListResult + + include MsRestAzure + + # @return [Array] List of Cassandra tables and + # their properties. + attr_accessor :value + + + # + # Mapper for CassandraTableListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableListResult', + type: { + name: 'Composite', + class_name: 'CassandraTableListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableGetResultsElementType', + type: { + name: 'Composite', + class_name: 'CassandraTableGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb new file mode 100644 index 000000000..16fe527ea --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB Cassandra table resource object + # + class CassandraTableResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table + attr_accessor :id + + # @return [Integer] Time to live of the Cosmos DB Cassandra table + attr_accessor :default_ttl + + # @return [CassandraSchema] Schema of the Cosmos DB Cassandra table + attr_accessor :schema + + + # + # Mapper for CassandraTableResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableResource', + type: { + name: 'Composite', + class_name: 'CassandraTableResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + schema: { + client_side_validation: true, + required: false, + serialized_name: 'schema', + type: { + name: 'Composite', + class_name: 'CassandraSchema' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cluster_key.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cluster_key.rb new file mode 100644 index 000000000..8c1a95c60 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/cluster_key.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB Cassandra table cluster key + # + class ClusterKey + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table cluster key + attr_accessor :name + + # @return [String] Order of the Cosmos DB Cassandra table cluster key, + # only support "Asc" and "Desc" + attr_accessor :order_by + + + # + # Mapper for ClusterKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ClusterKey', + type: { + name: 'Composite', + class_name: 'ClusterKey', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + order_by: { + client_side_validation: true, + required: false, + serialized_name: 'orderBy', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/column.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/column.rb new file mode 100644 index 000000000..e90fcb0d3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/column.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB Cassandra table column + # + class Column + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table column + attr_accessor :name + + # @return [String] Type of the Cosmos DB Cassandra table column + attr_accessor :type + + + # + # Mapper for Column class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Column', + type: { + name: 'Composite', + class_name: 'Column', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/composite_path.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/composite_path.rb new file mode 100644 index 000000000..bb59ab534 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/composite_path.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class CompositePath + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + # @return [CompositePathSortOrder] Sort order for composite paths. + # Possible values include: 'Ascending', 'Descending' + attr_accessor :order + + + # + # Mapper for CompositePath class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CompositePath', + type: { + name: 'Composite', + class_name: 'CompositePath', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + order: { + client_side_validation: true, + required: false, + serialized_name: 'order', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb new file mode 100644 index 000000000..bb9f62355 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for CompositePathSortOrder + # + module CompositePathSortOrder + Ascending = "Ascending" + Descending = "Descending" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb new file mode 100644 index 000000000..81138c54c --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for ConflictResolutionMode + # + module ConflictResolutionMode + LastWriterWins = "LastWriterWins" + Custom = "Custom" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb new file mode 100644 index 000000000..362995d19 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The conflict resolution policy for the container. + # + class ConflictResolutionPolicy + + include MsRestAzure + + # @return [ConflictResolutionMode] Indicates the conflict resolution + # mode. Possible values include: 'LastWriterWins', 'Custom'. Default + # value: 'LastWriterWins' . + attr_accessor :mode + + # @return [String] The conflict resolution path in the case of + # LastWriterWins mode. + attr_accessor :conflict_resolution_path + + # @return [String] The procedure to resolve conflicts in the case of + # custom mode. + attr_accessor :conflict_resolution_procedure + + + # + # Mapper for ConflictResolutionPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ConflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy', + model_properties: { + mode: { + client_side_validation: true, + required: false, + serialized_name: 'mode', + default_value: 'LastWriterWins', + type: { + name: 'String' + } + }, + conflict_resolution_path: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPath', + type: { + name: 'String' + } + }, + conflict_resolution_procedure: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionProcedure', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/connector_offer.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/connector_offer.rb new file mode 100644 index 000000000..c250bf5d3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/connector_offer.rb @@ -0,0 +1,15 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for ConnectorOffer + # + module ConnectorOffer + Small = "Small" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb new file mode 100644 index 000000000..5d7a7d523 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb @@ -0,0 +1,86 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The consistency policy for the Cosmos DB database account. + # + class ConsistencyPolicy + + include MsRestAzure + + # @return [DefaultConsistencyLevel] The default consistency level and + # configuration settings of the Cosmos DB account. Possible values + # include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', + # 'ConsistentPrefix' + attr_accessor :default_consistency_level + + # @return [Integer] When used with the Bounded Staleness consistency + # level, this value represents the number of stale requests tolerated. + # Accepted range for this value is 1 – 2,147,483,647. Required when + # defaultConsistencyPolicy is set to 'BoundedStaleness'. + attr_accessor :max_staleness_prefix + + # @return [Integer] When used with the Bounded Staleness consistency + # level, this value represents the time amount of staleness (in seconds) + # tolerated. Accepted range for this value is 5 - 86400. Required when + # defaultConsistencyPolicy is set to 'BoundedStaleness'. + attr_accessor :max_interval_in_seconds + + + # + # Mapper for ConsistencyPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ConsistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy', + model_properties: { + default_consistency_level: { + client_side_validation: true, + required: true, + serialized_name: 'defaultConsistencyLevel', + type: { + name: 'Enum', + module: 'DefaultConsistencyLevel' + } + }, + max_staleness_prefix: { + client_side_validation: true, + required: false, + serialized_name: 'maxStalenessPrefix', + constraints: { + InclusiveMaximum: 2147483647, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + max_interval_in_seconds: { + client_side_validation: true, + required: false, + serialized_name: 'maxIntervalInSeconds', + constraints: { + InclusiveMaximum: 86400, + InclusiveMinimum: 5 + }, + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb new file mode 100644 index 000000000..ed6d74e86 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The configuration of the partition key to be used for partitioning data + # into multiple partitions + # + class ContainerPartitionKey + + include MsRestAzure + + # @return [Array] List of paths using which data within the + # container can be partitioned + attr_accessor :paths + + # @return [PartitionKind] Indicates the kind of algorithm used for + # partitioning. Possible values include: 'Hash', 'Range'. Default value: + # 'Hash' . + attr_accessor :kind + + # @return [Integer] Indicates the version of the partition key definition + attr_accessor :version + + + # + # Mapper for ContainerPartitionKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ContainerPartitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey', + model_properties: { + paths: { + client_side_validation: true, + required: false, + serialized_name: 'paths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'Hash', + type: { + name: 'String' + } + }, + version: { + client_side_validation: true, + required: false, + serialized_name: 'version', + constraints: { + InclusiveMaximum: 2, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/create_update_options.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/create_update_options.rb new file mode 100644 index 000000000..ad99f96ec --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/create_update_options.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # CreateUpdateOptions are a list of key-value pairs that describe the + # resource. Supported keys are "If-Match", "If-None-Match", "Session-Token" + # and "Throughput" + # + class CreateUpdateOptions + + include MsRestAzure + + # @return [Hash{String => String}] Unmatched properties from the message + # are deserialized this collection + attr_accessor :additional_properties + + # @return [String] Request Units per second. For example, "throughput": + # "10000". + attr_accessor :throughput + + + # + # Mapper for CreateUpdateOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CreateUpdateOptions', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/data_type.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/data_type.rb new file mode 100644 index 000000000..82725b994 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/data_type.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for DataType + # + module DataType + String = "String" + Number = "Number" + Point = "Point" + Polygon = "Polygon" + LineString = "LineString" + MultiPolygon = "MultiPolygon" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb new file mode 100644 index 000000000..4d67dbb12 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Connection string for the Cosmos DB account + # + class DatabaseAccountConnectionString + + include MsRestAzure + + # @return [String] Value of the connection string + attr_accessor :connection_string + + # @return [String] Description of the connection string + attr_accessor :description + + + # + # Mapper for DatabaseAccountConnectionString class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountConnectionString', + type: { + name: 'Composite', + class_name: 'DatabaseAccountConnectionString', + model_properties: { + connection_string: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'connectionString', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb new file mode 100644 index 000000000..079d57851 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb @@ -0,0 +1,290 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB database accounts. + # + class DatabaseAccountCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [DatabaseAccountKind] Indicates the type of database account. + # This can only be set at database account creation. Possible values + # include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. Default value: + # 'GlobalDocumentDB' . + attr_accessor :kind + + # @return [ConsistencyPolicy] The consistency policy for the Cosmos DB + # account. + attr_accessor :consistency_policy + + # @return [Array] An array that contains the georeplication + # locations enabled for the Cosmos DB account. + attr_accessor :locations + + # @return [String] The offer type for the database. Default value: + # 'Standard' . + attr_accessor :database_account_offer_type + + # @return [String] Cosmos DB Firewall Support: This value specifies the + # set of IP addresses or IP address ranges in CIDR form to be included as + # the allowed list of client IPs for a given database account. IP + # addresses/ranges must be comma separated and must not contain any + # spaces. + attr_accessor :ip_range_filter + + # @return [Boolean] Flag to indicate whether to enable/disable Virtual + # Network ACL rules. + attr_accessor :is_virtual_network_filter_enabled + + # @return [Boolean] Enables automatic failover of the write region in the + # rare event that the region is unavailable due to an outage. Automatic + # failover will result in a new write region for the account and is + # chosen based on the failover priorities configured for the account. + attr_accessor :enable_automatic_failover + + # @return [Array] List of Cosmos DB capabilities for the + # account + attr_accessor :capabilities + + # @return [Array] List of Virtual Network ACL rules + # configured for the Cosmos DB account. + attr_accessor :virtual_network_rules + + # @return [Boolean] Enables the account to write in multiple locations + attr_accessor :enable_multiple_write_locations + + # @return [Boolean] Enables the cassandra connector on the Cosmos DB C* + # account + attr_accessor :enable_cassandra_connector + + # @return [ConnectorOffer] The cassandra connector offer type for the + # Cosmos DB database C* account. Possible values include: 'Small' + attr_accessor :connector_offer + + # @return [Boolean] Disable write operations on metadata resources + # (databases, containers, throughput) via account keys + attr_accessor :disable_key_based_metadata_write_access + + # @return [String] The URI of the key vault + attr_accessor :key_vault_key_uri + + + # + # Mapper for DatabaseAccountCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'DatabaseAccountCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'GlobalDocumentDB', + type: { + name: 'String' + } + }, + consistency_policy: { + client_side_validation: true, + required: false, + serialized_name: 'properties.consistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy' + } + }, + locations: { + client_side_validation: true, + required: true, + serialized_name: 'properties.locations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + database_account_offer_type: { + client_side_validation: true, + required: true, + is_constant: true, + serialized_name: 'properties.databaseAccountOfferType', + default_value: 'Standard', + type: { + name: 'String' + } + }, + ip_range_filter: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ipRangeFilter', + type: { + name: 'String' + } + }, + is_virtual_network_filter_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isVirtualNetworkFilterEnabled', + type: { + name: 'Boolean' + } + }, + enable_automatic_failover: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAutomaticFailover', + type: { + name: 'Boolean' + } + }, + capabilities: { + client_side_validation: true, + required: false, + serialized_name: 'properties.capabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CapabilityElementType', + type: { + name: 'Composite', + class_name: 'Capability' + } + } + } + }, + virtual_network_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRuleElementType', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule' + } + } + } + }, + enable_multiple_write_locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableMultipleWriteLocations', + type: { + name: 'Boolean' + } + }, + enable_cassandra_connector: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableCassandraConnector', + type: { + name: 'Boolean' + } + }, + connector_offer: { + client_side_validation: true, + required: false, + serialized_name: 'properties.connectorOffer', + type: { + name: 'String' + } + }, + disable_key_based_metadata_write_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disableKeyBasedMetadataWriteAccess', + type: { + name: 'Boolean' + } + }, + key_vault_key_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.keyVaultKeyUri', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb new file mode 100644 index 000000000..976f125f5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb @@ -0,0 +1,382 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB database account. + # + class DatabaseAccountGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [DatabaseAccountKind] Indicates the type of database account. + # This can only be set at database account creation. Possible values + # include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. Default value: + # 'GlobalDocumentDB' . + attr_accessor :kind + + # @return [String] + attr_accessor :provisioning_state + + # @return [String] The connection endpoint for the Cosmos DB database + # account. + attr_accessor :document_endpoint + + # @return [DatabaseAccountOfferType] The offer type for the Cosmos DB + # database account. Default value: Standard. Possible values include: + # 'Standard' + attr_accessor :database_account_offer_type + + # @return [String] Cosmos DB Firewall Support: This value specifies the + # set of IP addresses or IP address ranges in CIDR form to be included as + # the allowed list of client IPs for a given database account. IP + # addresses/ranges must be comma separated and must not contain any + # spaces. + attr_accessor :ip_range_filter + + # @return [Boolean] Flag to indicate whether to enable/disable Virtual + # Network ACL rules. + attr_accessor :is_virtual_network_filter_enabled + + # @return [Boolean] Enables automatic failover of the write region in the + # rare event that the region is unavailable due to an outage. Automatic + # failover will result in a new write region for the account and is + # chosen based on the failover priorities configured for the account. + attr_accessor :enable_automatic_failover + + # @return [ConsistencyPolicy] The consistency policy for the Cosmos DB + # database account. + attr_accessor :consistency_policy + + # @return [Array] List of Cosmos DB capabilities for the + # account + attr_accessor :capabilities + + # @return [Array] An array that contains the write location for + # the Cosmos DB account. + attr_accessor :write_locations + + # @return [Array] An array that contains of the read locations + # enabled for the Cosmos DB account. + attr_accessor :read_locations + + # @return [Array] An array that contains all of the locations + # enabled for the Cosmos DB account. + attr_accessor :locations + + # @return [Array] An array that contains the regions + # ordered by their failover priorities. + attr_accessor :failover_policies + + # @return [Array] List of Virtual Network ACL rules + # configured for the Cosmos DB account. + attr_accessor :virtual_network_rules + + # @return [Boolean] Enables the account to write in multiple locations + attr_accessor :enable_multiple_write_locations + + # @return [Boolean] Enables the cassandra connector on the Cosmos DB C* + # account + attr_accessor :enable_cassandra_connector + + # @return [ConnectorOffer] The cassandra connector offer type for the + # Cosmos DB database C* account. Possible values include: 'Small' + attr_accessor :connector_offer + + # @return [Boolean] Disable write operations on metadata resources + # (databases, containers, throughput) via account keys + attr_accessor :disable_key_based_metadata_write_access + + # @return [String] The URI of the key vault + attr_accessor :key_vault_key_uri + + + # + # Mapper for DatabaseAccountGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountGetResults', + type: { + name: 'Composite', + class_name: 'DatabaseAccountGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'GlobalDocumentDB', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + document_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.documentEndpoint', + type: { + name: 'String' + } + }, + database_account_offer_type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.databaseAccountOfferType', + type: { + name: 'Enum', + module: 'DatabaseAccountOfferType' + } + }, + ip_range_filter: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ipRangeFilter', + type: { + name: 'String' + } + }, + is_virtual_network_filter_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isVirtualNetworkFilterEnabled', + type: { + name: 'Boolean' + } + }, + enable_automatic_failover: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAutomaticFailover', + type: { + name: 'Boolean' + } + }, + consistency_policy: { + client_side_validation: true, + required: false, + serialized_name: 'properties.consistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy' + } + }, + capabilities: { + client_side_validation: true, + required: false, + serialized_name: 'properties.capabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CapabilityElementType', + type: { + name: 'Composite', + class_name: 'Capability' + } + } + } + }, + write_locations: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.writeLocations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + read_locations: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.readLocations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + locations: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.locations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + failover_policies: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.failoverPolicies', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicyElementType', + type: { + name: 'Composite', + class_name: 'FailoverPolicy' + } + } + } + }, + virtual_network_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRuleElementType', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule' + } + } + } + }, + enable_multiple_write_locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableMultipleWriteLocations', + type: { + name: 'Boolean' + } + }, + enable_cassandra_connector: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableCassandraConnector', + type: { + name: 'Boolean' + } + }, + connector_offer: { + client_side_validation: true, + required: false, + serialized_name: 'properties.connectorOffer', + type: { + name: 'String' + } + }, + disable_key_based_metadata_write_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disableKeyBasedMetadataWriteAccess', + type: { + name: 'Boolean' + } + }, + key_vault_key_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.keyVaultKeyUri', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb new file mode 100644 index 000000000..4b81995cf --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for DatabaseAccountKind + # + module DatabaseAccountKind + GlobalDocumentDB = "GlobalDocumentDB" + MongoDB = "MongoDB" + Parse = "Parse" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb new file mode 100644 index 000000000..a810f68c3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The connection strings for the given database account. + # + class DatabaseAccountListConnectionStringsResult + + include MsRestAzure + + # @return [Array] An array that contains + # the connection strings for the Cosmos DB account. + attr_accessor :connection_strings + + + # + # Mapper for DatabaseAccountListConnectionStringsResult class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountListConnectionStringsResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountListConnectionStringsResult', + model_properties: { + connection_strings: { + client_side_validation: true, + required: false, + serialized_name: 'connectionStrings', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountConnectionStringElementType', + type: { + name: 'Composite', + class_name: 'DatabaseAccountConnectionString' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb new file mode 100644 index 000000000..05a4ef844 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The access keys for the given database account. + # + class DatabaseAccountListKeysResult < DatabaseAccountListReadOnlyKeysResult + + include MsRestAzure + + # @return [String] Base 64 encoded value of the primary read-write key. + attr_accessor :primary_master_key + + # @return [String] Base 64 encoded value of the secondary read-write key. + attr_accessor :secondary_master_key + + + # + # Mapper for DatabaseAccountListKeysResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountListKeysResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountListKeysResult', + model_properties: { + primary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryReadonlyMasterKey', + type: { + name: 'String' + } + }, + secondary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'secondaryReadonlyMasterKey', + type: { + name: 'String' + } + }, + primary_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryMasterKey', + type: { + name: 'String' + } + }, + secondary_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'secondaryMasterKey', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb new file mode 100644 index 000000000..e59f84f6d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The read-only access keys for the given database account. + # + class DatabaseAccountListReadOnlyKeysResult + + include MsRestAzure + + # @return [String] Base 64 encoded value of the primary read-only key. + attr_accessor :primary_readonly_master_key + + # @return [String] Base 64 encoded value of the secondary read-only key. + attr_accessor :secondary_readonly_master_key + + + # + # Mapper for DatabaseAccountListReadOnlyKeysResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountListReadOnlyKeysResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountListReadOnlyKeysResult', + model_properties: { + primary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryReadonlyMasterKey', + type: { + name: 'String' + } + }, + secondary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'secondaryReadonlyMasterKey', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb new file mode 100644 index 000000000..fc89218d3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb @@ -0,0 +1,15 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for DatabaseAccountOfferType + # + module DatabaseAccountOfferType + Standard = "Standard" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb new file mode 100644 index 000000000..f3ab8b058 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to regenerate the keys within the database account. + # + class DatabaseAccountRegenerateKeyParameters + + include MsRestAzure + + # @return [KeyKind] The access key to regenerate. Possible values + # include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + attr_accessor :key_kind + + + # + # Mapper for DatabaseAccountRegenerateKeyParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountRegenerateKeyParameters', + type: { + name: 'Composite', + class_name: 'DatabaseAccountRegenerateKeyParameters', + model_properties: { + key_kind: { + client_side_validation: true, + required: true, + serialized_name: 'keyKind', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb new file mode 100644 index 000000000..d91b55d3b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb @@ -0,0 +1,241 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters for patching Azure Cosmos DB database account properties. + # + class DatabaseAccountUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] + attr_accessor :tags + + # @return [String] The location of the resource group to which the + # resource belongs. + attr_accessor :location + + # @return [ConsistencyPolicy] The consistency policy for the Cosmos DB + # account. + attr_accessor :consistency_policy + + # @return [Array] An array that contains the georeplication + # locations enabled for the Cosmos DB account. + attr_accessor :locations + + # @return [String] Cosmos DB Firewall Support: This value specifies the + # set of IP addresses or IP address ranges in CIDR form to be included as + # the allowed list of client IPs for a given database account. IP + # addresses/ranges must be comma separated and must not contain any + # spaces. + attr_accessor :ip_range_filter + + # @return [Boolean] Flag to indicate whether to enable/disable Virtual + # Network ACL rules. + attr_accessor :is_virtual_network_filter_enabled + + # @return [Boolean] Enables automatic failover of the write region in the + # rare event that the region is unavailable due to an outage. Automatic + # failover will result in a new write region for the account and is + # chosen based on the failover priorities configured for the account. + attr_accessor :enable_automatic_failover + + # @return [Array] List of Cosmos DB capabilities for the + # account + attr_accessor :capabilities + + # @return [Array] List of Virtual Network ACL rules + # configured for the Cosmos DB account. + attr_accessor :virtual_network_rules + + # @return [Boolean] Enables the account to write in multiple locations + attr_accessor :enable_multiple_write_locations + + # @return [Boolean] Enables the cassandra connector on the Cosmos DB C* + # account + attr_accessor :enable_cassandra_connector + + # @return [ConnectorOffer] The cassandra connector offer type for the + # Cosmos DB database C* account. Possible values include: 'Small' + attr_accessor :connector_offer + + # @return [Boolean] Disable write operations on metadata resources + # (databases, containers, throughput) via account keys + attr_accessor :disable_key_based_metadata_write_access + + # @return [String] The URI of the key vault + attr_accessor :key_vault_key_uri + + + # + # Mapper for DatabaseAccountUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountUpdateParameters', + type: { + name: 'Composite', + class_name: 'DatabaseAccountUpdateParameters', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + consistency_policy: { + client_side_validation: true, + required: false, + serialized_name: 'properties.consistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy' + } + }, + locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.locations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + ip_range_filter: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ipRangeFilter', + type: { + name: 'String' + } + }, + is_virtual_network_filter_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isVirtualNetworkFilterEnabled', + type: { + name: 'Boolean' + } + }, + enable_automatic_failover: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAutomaticFailover', + type: { + name: 'Boolean' + } + }, + capabilities: { + client_side_validation: true, + required: false, + serialized_name: 'properties.capabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CapabilityElementType', + type: { + name: 'Composite', + class_name: 'Capability' + } + } + } + }, + virtual_network_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRuleElementType', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule' + } + } + } + }, + enable_multiple_write_locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableMultipleWriteLocations', + type: { + name: 'Boolean' + } + }, + enable_cassandra_connector: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableCassandraConnector', + type: { + name: 'Boolean' + } + }, + connector_offer: { + client_side_validation: true, + required: false, + serialized_name: 'properties.connectorOffer', + type: { + name: 'String' + } + }, + disable_key_based_metadata_write_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disableKeyBasedMetadataWriteAccess', + type: { + name: 'Boolean' + } + }, + key_vault_key_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.keyVaultKeyUri', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb new file mode 100644 index 000000000..7a42912af --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the database accounts and + # their properties. + # + class DatabaseAccountsListResult + + include MsRestAzure + + # @return [Array] List of database account and + # their properties. + attr_accessor :value + + + # + # Mapper for DatabaseAccountsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountsListResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountGetResultsElementType', + type: { + name: 'Composite', + class_name: 'DatabaseAccountGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb new file mode 100644 index 000000000..2c4602341 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for DefaultConsistencyLevel + # + module DefaultConsistencyLevel + Eventual = "Eventual" + Session = "Session" + BoundedStaleness = "BoundedStaleness" + Strong = "Strong" + ConsistentPrefix = "ConsistentPrefix" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/error_response.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/error_response.rb new file mode 100644 index 000000000..cca968bfe --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/error_response.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Error Response. + # + class ErrorResponse + + include MsRestAzure + + # @return [String] Error code. + attr_accessor :code + + # @return [String] Error message indicating why the operation failed. + attr_accessor :message + + + # + # Mapper for ErrorResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ErrorResponse', + type: { + name: 'Composite', + class_name: 'ErrorResponse', + model_properties: { + code: { + client_side_validation: true, + required: false, + serialized_name: 'code', + type: { + name: 'String' + } + }, + message: { + client_side_validation: true, + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/excluded_path.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/excluded_path.rb new file mode 100644 index 000000000..7d2ba1d65 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/excluded_path.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class ExcludedPath + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + + # + # Mapper for ExcludedPath class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExcludedPath', + type: { + name: 'Composite', + class_name: 'ExcludedPath', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb new file mode 100644 index 000000000..842c55996 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb @@ -0,0 +1,74 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The system generated resource properties associated with SQL databases, + # SQL containers, Gremlin databases and Gremlin graphs. + # + class ExtendedResourceProperties + + include MsRestAzure + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for ExtendedResourceProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExtendedResourceProperties', + type: { + name: 'Composite', + class_name: 'ExtendedResourceProperties', + model_properties: { + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/failover_policies.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/failover_policies.rb new file mode 100644 index 000000000..8c28321ec --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/failover_policies.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The list of new failover policies for the failover priority change. + # + class FailoverPolicies + + include MsRestAzure + + # @return [Array] List of failover policies. + attr_accessor :failover_policies + + + # + # Mapper for FailoverPolicies class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicies', + type: { + name: 'Composite', + class_name: 'FailoverPolicies', + model_properties: { + failover_policies: { + client_side_validation: true, + required: true, + serialized_name: 'failoverPolicies', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicyElementType', + type: { + name: 'Composite', + class_name: 'FailoverPolicy' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/failover_policy.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/failover_policy.rb new file mode 100644 index 000000000..9063226e4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/failover_policy.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The failover policy for a given region of a database account. + # + class FailoverPolicy + + include MsRestAzure + + # @return [String] The unique identifier of the region in which the + # database account replicates to. Example: + # <accountName>-<locationName>. + attr_accessor :id + + # @return [String] The name of the region in which the database account + # exists. + attr_accessor :location_name + + # @return [Integer] The failover priority of the region. A failover + # priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority + # values must be unique for each of the regions in which the database + # account exists. + attr_accessor :failover_priority + + + # + # Mapper for FailoverPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicy', + type: { + name: 'Composite', + class_name: 'FailoverPolicy', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + location_name: { + client_side_validation: true, + required: false, + serialized_name: 'locationName', + type: { + name: 'String' + } + }, + failover_priority: { + client_side_validation: true, + required: false, + serialized_name: 'failoverPriority', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb new file mode 100644 index 000000000..9a64a42f4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB Gremlin database. + # + class GremlinDatabaseCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinDatabaseResource] The standard JSON format of a Gremlin + # database + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for GremlinDatabaseCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb new file mode 100644 index 000000000..8c7668c8c --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class GremlinDatabaseGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin database + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for GremlinDatabaseGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseGetProperties_resource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb new file mode 100644 index 000000000..2af0990cc --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB Gremlin database. + # + class GremlinDatabaseGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinDatabaseGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for GremlinDatabaseGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseGetResults', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb new file mode 100644 index 000000000..c8e018faf --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the Gremlin databases and + # their properties. + # + class GremlinDatabaseListResult + + include MsRestAzure + + # @return [Array] List of Gremlin databases + # and their properties. + attr_accessor :value + + + # + # Mapper for GremlinDatabaseListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseListResult', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseGetResultsElementType', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb new file mode 100644 index 000000000..e48faa6c1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB Gremlin database resource object + # + class GremlinDatabaseResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin database + attr_accessor :id + + + # + # Mapper for GremlinDatabaseResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseResource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb new file mode 100644 index 000000000..91083418b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB Gremlin graph. + # + class GremlinGraphCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinGraphResource] The standard JSON format of a Gremlin + # graph + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for GremlinGraphCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'GremlinGraphCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinGraphResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb new file mode 100644 index 000000000..3641797cc --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb @@ -0,0 +1,150 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class GremlinGraphGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin graph + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # graph + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the graph. + attr_accessor :conflict_resolution_policy + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for GremlinGraphGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphGetProperties_resource', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb new file mode 100644 index 000000000..24bed7708 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB Gremlin graph. + # + class GremlinGraphGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinGraphGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for GremlinGraphGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphGetResults', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb new file mode 100644 index 000000000..46a9e65b2 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the graphs and their + # properties. + # + class GremlinGraphListResult + + include MsRestAzure + + # @return [Array] List of graphs and their + # properties. + attr_accessor :value + + + # + # Mapper for GremlinGraphListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphListResult', + type: { + name: 'Composite', + class_name: 'GremlinGraphListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphGetResultsElementType', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb new file mode 100644 index 000000000..d61dcbb0d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB Gremlin graph resource object + # + class GremlinGraphResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin graph + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # graph + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the graph. + attr_accessor :conflict_resolution_policy + + + # + # Mapper for GremlinGraphResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphResource', + type: { + name: 'Composite', + class_name: 'GremlinGraphResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/included_path.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/included_path.rb new file mode 100644 index 000000000..ac918ce79 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/included_path.rb @@ -0,0 +1,67 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The paths that are included in indexing + # + class IncludedPath + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + # @return [Array] List of indexes for this path + attr_accessor :indexes + + + # + # Mapper for IncludedPath class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'IncludedPath', + type: { + name: 'Composite', + class_name: 'IncludedPath', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + indexes: { + client_side_validation: true, + required: false, + serialized_name: 'indexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'IndexesElementType', + type: { + name: 'Composite', + class_name: 'Indexes' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/index_kind.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/index_kind.rb new file mode 100644 index 000000000..4fd76bab8 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/index_kind.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for IndexKind + # + module IndexKind + Hash = "Hash" + Range = "Range" + Spatial = "Spatial" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexes.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexes.rb new file mode 100644 index 000000000..8fad9519b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexes.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The indexes for the path. + # + class Indexes + + include MsRestAzure + + # @return [DataType] The datatype for which the indexing behavior is + # applied to. Possible values include: 'String', 'Number', 'Point', + # 'Polygon', 'LineString', 'MultiPolygon'. Default value: 'String' . + attr_accessor :data_type + + # @return [Integer] The precision of the index. -1 is maximum precision. + attr_accessor :precision + + # @return [IndexKind] Indicates the type of index. Possible values + # include: 'Hash', 'Range', 'Spatial'. Default value: 'Hash' . + attr_accessor :kind + + + # + # Mapper for Indexes class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Indexes', + type: { + name: 'Composite', + class_name: 'Indexes', + model_properties: { + data_type: { + client_side_validation: true, + required: false, + serialized_name: 'dataType', + default_value: 'String', + type: { + name: 'String' + } + }, + precision: { + client_side_validation: true, + required: false, + serialized_name: 'precision', + type: { + name: 'Number' + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'Hash', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb new file mode 100644 index 000000000..a57a6d127 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for IndexingMode + # + module IndexingMode + Consistent = "Consistent" + Lazy = "Lazy" + None = "None" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb new file mode 100644 index 000000000..7ea4436e9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb @@ -0,0 +1,147 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB indexing policy + # + class IndexingPolicy + + include MsRestAzure + + # @return [Boolean] Indicates if the indexing policy is automatic + attr_accessor :automatic + + # @return [IndexingMode] Indicates the indexing mode. Possible values + # include: 'Consistent', 'Lazy', 'None'. Default value: 'Consistent' . + attr_accessor :indexing_mode + + # @return [Array] List of paths to include in the indexing + attr_accessor :included_paths + + # @return [Array] List of paths to exclude from indexing + attr_accessor :excluded_paths + + # @return [Array>] List of composite path list + attr_accessor :composite_indexes + + # @return [Array] List of spatial specifics + attr_accessor :spatial_indexes + + + # + # Mapper for IndexingPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'IndexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy', + model_properties: { + automatic: { + client_side_validation: true, + required: false, + serialized_name: 'automatic', + type: { + name: 'Boolean' + } + }, + indexing_mode: { + client_side_validation: true, + required: false, + serialized_name: 'indexingMode', + default_value: 'Consistent', + type: { + name: 'String' + } + }, + included_paths: { + client_side_validation: true, + required: false, + serialized_name: 'includedPaths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'IncludedPathElementType', + type: { + name: 'Composite', + class_name: 'IncludedPath' + } + } + } + }, + excluded_paths: { + client_side_validation: true, + required: false, + serialized_name: 'excludedPaths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ExcludedPathElementType', + type: { + name: 'Composite', + class_name: 'ExcludedPath' + } + } + } + }, + composite_indexes: { + client_side_validation: true, + required: false, + serialized_name: 'compositeIndexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CompositePathElementType', + type: { + name: 'Composite', + class_name: 'CompositePath' + } + } + } + } + } + }, + spatial_indexes: { + client_side_validation: true, + required: false, + serialized_name: 'spatialIndexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SpatialSpecElementType', + type: { + name: 'Composite', + class_name: 'SpatialSpec' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/key_kind.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/key_kind.rb new file mode 100644 index 000000000..0da81400b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/key_kind.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for KeyKind + # + module KeyKind + Primary = "primary" + Secondary = "secondary" + PrimaryReadonly = "primaryReadonly" + SecondaryReadonly = "secondaryReadonly" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/location.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/location.rb new file mode 100644 index 000000000..874fe8fbc --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/location.rb @@ -0,0 +1,114 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # A region in which the Azure Cosmos DB database account is deployed. + # + class Location + + include MsRestAzure + + # @return [String] The unique identifier of the region within the + # database account. Example: <accountName>-<locationName>. + attr_accessor :id + + # @return [String] The name of the region. + attr_accessor :location_name + + # @return [String] The connection endpoint for the specific region. + # Example: + # https://<accountName>-<locationName>.documents.azure.com:443/ + attr_accessor :document_endpoint + + # @return [String] + attr_accessor :provisioning_state + + # @return [Integer] The failover priority of the region. A failover + # priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority + # values must be unique for each of the regions in which the database + # account exists. + attr_accessor :failover_priority + + # @return [Boolean] Flag to indicate whether or not this region is an + # AvailabilityZone region + attr_accessor :is_zone_redundant + + + # + # Mapper for Location class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Location', + type: { + name: 'Composite', + class_name: 'Location', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + location_name: { + client_side_validation: true, + required: false, + serialized_name: 'locationName', + type: { + name: 'String' + } + }, + document_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'documentEndpoint', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'provisioningState', + type: { + name: 'String' + } + }, + failover_priority: { + client_side_validation: true, + required: false, + serialized_name: 'failoverPriority', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, + is_zone_redundant: { + client_side_validation: true, + required: false, + serialized_name: 'isZoneRedundant', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric.rb new file mode 100644 index 000000000..ee31fbaa1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric.rb @@ -0,0 +1,120 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Metric data + # + class Metric + + include MsRestAzure + + # @return [DateTime] The start time for the metric (ISO-8601 format). + attr_accessor :start_time + + # @return [DateTime] The end time for the metric (ISO-8601 format). + attr_accessor :end_time + + # @return [String] The time grain to be used to summarize the metric + # values. + attr_accessor :time_grain + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + # @return [Array] The metric values for the specified time + # window and timestep. + attr_accessor :metric_values + + + # + # Mapper for Metric class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Metric', + type: { + name: 'Composite', + class_name: 'Metric', + model_properties: { + start_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + end_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'endTime', + type: { + name: 'DateTime' + } + }, + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + metric_values: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricValues', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricValueElementType', + type: { + name: 'Composite', + class_name: 'MetricValue' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_availability.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_availability.rb new file mode 100644 index 000000000..93552900e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_availability.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The availability of the metric. + # + class MetricAvailability + + include MsRestAzure + + # @return [String] The time grain to be used to summarize the metric + # values. + attr_accessor :time_grain + + # @return [String] The retention for the metric values. + attr_accessor :retention + + + # + # Mapper for MetricAvailability class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricAvailability', + type: { + name: 'Composite', + class_name: 'MetricAvailability', + model_properties: { + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + retention: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'retention', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_definition.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_definition.rb new file mode 100644 index 000000000..4229be700 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_definition.rb @@ -0,0 +1,109 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The definition of a metric. + # + class MetricDefinition + + include MsRestAzure + + # @return [Array] The list of metric availabilities + # for the account. + attr_accessor :metric_availabilities + + # @return [PrimaryAggregationType] The primary aggregation type of the + # metric. Possible values include: 'None', 'Average', 'Total', 'Minimum', + # 'Maximum', 'Last' + attr_accessor :primary_aggregation_type + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [String] The resource uri of the database. + attr_accessor :resource_uri + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + + # + # Mapper for MetricDefinition class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricDefinition', + type: { + name: 'Composite', + class_name: 'MetricDefinition', + model_properties: { + metric_availabilities: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricAvailabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricAvailabilityElementType', + type: { + name: 'Composite', + class_name: 'MetricAvailability' + } + } + } + }, + primary_aggregation_type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryAggregationType', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + resource_uri: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'resourceUri', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb new file mode 100644 index 000000000..e7c5e482b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The response to a list metric definitions request. + # + class MetricDefinitionsListResult + + include MsRestAzure + + # @return [Array] The list of metric definitions for + # the account. + attr_accessor :value + + + # + # Mapper for MetricDefinitionsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricDefinitionsListResult', + type: { + name: 'Composite', + class_name: 'MetricDefinitionsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricDefinitionElementType', + type: { + name: 'Composite', + class_name: 'MetricDefinition' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb new file mode 100644 index 000000000..dc26b21b9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The response to a list metrics request. + # + class MetricListResult + + include MsRestAzure + + # @return [Array] The list of metrics for the account. + attr_accessor :value + + + # + # Mapper for MetricListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricListResult', + type: { + name: 'Composite', + class_name: 'MetricListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricElementType', + type: { + name: 'Composite', + class_name: 'Metric' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_name.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_name.rb new file mode 100644 index 000000000..c6eb5b1ec --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_name.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # A metric name. + # + class MetricName + + include MsRestAzure + + # @return [String] The name of the metric. + attr_accessor :value + + # @return [String] The friendly name of the metric. + attr_accessor :localized_value + + + # + # Mapper for MetricName class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricName', + type: { + name: 'Composite', + class_name: 'MetricName', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'String' + } + }, + localized_value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'localizedValue', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_value.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_value.rb new file mode 100644 index 000000000..23e56467b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/metric_value.rb @@ -0,0 +1,107 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Represents metrics values. + # + class MetricValue + + include MsRestAzure + + # @return [Float] The number of values for the metric. + attr_accessor :_count + + # @return [Float] The average value of the metric. + attr_accessor :average + + # @return [Float] The max value of the metric. + attr_accessor :maximum + + # @return [Float] The min value of the metric. + attr_accessor :minimum + + # @return [DateTime] The metric timestamp (ISO-8601 format). + attr_accessor :timestamp + + # @return [Float] The total value of the metric. + attr_accessor :total + + + # + # Mapper for MetricValue class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricValue', + type: { + name: 'Composite', + class_name: 'MetricValue', + model_properties: { + _count: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_count', + type: { + name: 'Double' + } + }, + average: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'average', + type: { + name: 'Double' + } + }, + maximum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'maximum', + type: { + name: 'Double' + } + }, + minimum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimum', + type: { + name: 'Double' + } + }, + timestamp: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timestamp', + type: { + name: 'DateTime' + } + }, + total: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'total', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb new file mode 100644 index 000000000..3b3af2a81 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB MongoDB collection. + # + class MongoDBCollectionCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBCollectionResource] The standard JSON format of a + # MongoDB collection + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for MongoDBCollectionCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb new file mode 100644 index 000000000..e49f4a2c6 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb @@ -0,0 +1,125 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class MongoDBCollectionGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB collection + attr_accessor :id + + # @return [Hash{String => String}] A key-value pair of shard keys to be + # applied for the request. + attr_accessor :shard_key + + # @return [Array] List of index keys + attr_accessor :indexes + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for MongoDBCollectionGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionGetProperties_resource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + shard_key: { + client_side_validation: true, + required: false, + serialized_name: 'shardKey', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + indexes: { + client_side_validation: true, + required: false, + serialized_name: 'indexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexElementType', + type: { + name: 'Composite', + class_name: 'MongoIndex' + } + } + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb new file mode 100644 index 000000000..57cf65317 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB MongoDB collection. + # + class MongoDBCollectionGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBCollectionGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for MongoDBCollectionGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionGetResults', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb new file mode 100644 index 000000000..aebd8213e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the MongoDB collections and + # their properties. + # + class MongoDBCollectionListResult + + include MsRestAzure + + # @return [Array] List of MongoDB + # collections and their properties. + attr_accessor :value + + + # + # Mapper for MongoDBCollectionListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionListResult', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionGetResultsElementType', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb new file mode 100644 index 000000000..1399ff90f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb @@ -0,0 +1,86 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB MongoDB collection resource object + # + class MongoDBCollectionResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB collection + attr_accessor :id + + # @return [Hash{String => String}] A key-value pair of shard keys to be + # applied for the request. + attr_accessor :shard_key + + # @return [Array] List of index keys + attr_accessor :indexes + + + # + # Mapper for MongoDBCollectionResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionResource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + shard_key: { + client_side_validation: true, + required: false, + serialized_name: 'shardKey', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + indexes: { + client_side_validation: true, + required: false, + serialized_name: 'indexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexElementType', + type: { + name: 'Composite', + class_name: 'MongoIndex' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb new file mode 100644 index 000000000..d4ab94cf9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB MongoDB database. + # + class MongoDBDatabaseCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBDatabaseResource] The standard JSON format of a MongoDB + # database + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for MongoDBDatabaseCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb new file mode 100644 index 000000000..f15d5c843 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class MongoDBDatabaseGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB database + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for MongoDBDatabaseGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseGetProperties_resource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb new file mode 100644 index 000000000..6692158cb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB MongoDB database. + # + class MongoDBDatabaseGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBDatabaseGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for MongoDBDatabaseGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseGetResults', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb new file mode 100644 index 000000000..4ddfb2bec --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the MongoDB databases and + # their properties. + # + class MongoDBDatabaseListResult + + include MsRestAzure + + # @return [Array] List of MongoDB databases + # and their properties. + attr_accessor :value + + + # + # Mapper for MongoDBDatabaseListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseListResult', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseGetResultsElementType', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb new file mode 100644 index 000000000..e5410dc2f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB MongoDB database resource object + # + class MongoDBDatabaseResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB database + attr_accessor :id + + + # + # Mapper for MongoDBDatabaseResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseResource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index.rb new file mode 100644 index 000000000..3c1db523e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB MongoDB collection index key + # + class MongoIndex + + include MsRestAzure + + # @return [MongoIndexKeys] Cosmos DB MongoDB collection index keys + attr_accessor :key + + # @return [MongoIndexOptions] Cosmos DB MongoDB collection index key + # options + attr_accessor :options + + + # + # Mapper for MongoIndex class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndex', + type: { + name: 'Composite', + class_name: 'MongoIndex', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'Composite', + class_name: 'MongoIndexKeys' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'options', + type: { + name: 'Composite', + class_name: 'MongoIndexOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb new file mode 100644 index 000000000..a0f55cb5e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB MongoDB collection resource object + # + class MongoIndexKeys + + include MsRestAzure + + # @return [Array] List of keys for each MongoDB collection in the + # Azure Cosmos DB service + attr_accessor :keys + + + # + # Mapper for MongoIndexKeys class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexKeys', + type: { + name: 'Composite', + class_name: 'MongoIndexKeys', + model_properties: { + keys: { + client_side_validation: true, + required: false, + serialized_name: 'keys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb new file mode 100644 index 000000000..ffc45dc26 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB MongoDB collection index options + # + class MongoIndexOptions + + include MsRestAzure + + # @return [Integer] Expire after seconds + attr_accessor :expire_after_seconds + + # @return [Boolean] Is unique or not + attr_accessor :unique + + + # + # Mapper for MongoIndexOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexOptions', + type: { + name: 'Composite', + class_name: 'MongoIndexOptions', + model_properties: { + expire_after_seconds: { + client_side_validation: true, + required: false, + serialized_name: 'expireAfterSeconds', + type: { + name: 'Number' + } + }, + unique: { + client_side_validation: true, + required: false, + serialized_name: 'unique', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb new file mode 100644 index 000000000..2ab1a8895 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb @@ -0,0 +1,87 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # A notebook workspace resource + # + class NotebookWorkspace < ARMProxyResource + + include MsRestAzure + + # @return [String] Specifies the endpoint of Notebook server. + attr_accessor :notebook_server_endpoint + + # @return [String] Status of the notebook workspace. Possible values are: + # Creating, Online, Deleting, Failed, Updating. + attr_accessor :status + + + # + # Mapper for NotebookWorkspace class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspace', + type: { + name: 'Composite', + class_name: 'NotebookWorkspace', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + notebook_server_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.notebookServerEndpoint', + type: { + name: 'String' + } + }, + status: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.status', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb new file mode 100644 index 000000000..f4436d86c --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The connection info for the given notebook workspace + # + class NotebookWorkspaceConnectionInfoResult + + include MsRestAzure + + # @return [String] Specifies auth token used for connecting to Notebook + # server (uses token-based auth). + attr_accessor :auth_token + + # @return [String] Specifies the endpoint of Notebook server. + attr_accessor :notebook_server_endpoint + + + # + # Mapper for NotebookWorkspaceConnectionInfoResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceConnectionInfoResult', + type: { + name: 'Composite', + class_name: 'NotebookWorkspaceConnectionInfoResult', + model_properties: { + auth_token: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'authToken', + type: { + name: 'String' + } + }, + notebook_server_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'notebookServerEndpoint', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb new file mode 100644 index 000000000..a46dfcc12 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb @@ -0,0 +1,62 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create a notebook workspace resource + # + class NotebookWorkspaceCreateUpdateParameters < ARMProxyResource + + include MsRestAzure + + + # + # Mapper for NotebookWorkspaceCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'NotebookWorkspaceCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb new file mode 100644 index 000000000..c1b850fe5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # A list of notebook workspace resources + # + class NotebookWorkspaceListResult + + include MsRestAzure + + # @return [Array] Array of notebook workspace + # resources + attr_accessor :value + + + # + # Mapper for NotebookWorkspaceListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceListResult', + type: { + name: 'Composite', + class_name: 'NotebookWorkspaceListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceElementType', + type: { + name: 'Composite', + class_name: 'NotebookWorkspace' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation.rb new file mode 100644 index 000000000..8daaf66ea --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # REST API operation + # + class Operation + + include MsRestAzure + + # @return [String] Operation name: {provider}/{resource}/{operation} + attr_accessor :name + + # @return [OperationDisplay] The object that represents the operation. + attr_accessor :display + + + # + # Mapper for Operation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Operation', + type: { + name: 'Composite', + class_name: 'Operation', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + client_side_validation: true, + required: false, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationDisplay' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation_display.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation_display.rb new file mode 100644 index 000000000..2ef07b0be --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation_display.rb @@ -0,0 +1,80 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The object that represents the operation. + # + class OperationDisplay + + include MsRestAzure + + # @return [String] Service provider: Microsoft.ResourceProvider + attr_accessor :provider + + # @return [String] Resource on which the operation is performed: Profile, + # endpoint, etc. + attr_accessor :resource + + # @return [String] Operation type: Read, write, delete, etc. + attr_accessor :operation + + # @return [String] Description of operation + attr_accessor :description + + + # + # Mapper for OperationDisplay class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Operation_display', + type: { + name: 'Composite', + class_name: 'OperationDisplay', + model_properties: { + provider: { + client_side_validation: true, + required: false, + serialized_name: 'Provider', + type: { + name: 'String' + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'Resource', + type: { + name: 'String' + } + }, + operation: { + client_side_validation: true, + required: false, + serialized_name: 'Operation', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'Description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb new file mode 100644 index 000000000..7e31d0bf1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # 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. + # + class OperationListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] List of operations supported by the Resource + # Provider. + attr_accessor :value + + # @return [String] URL to get the next set of operation list results if + # there are any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [OperationListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for OperationListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationListResult', + type: { + name: 'Composite', + class_name: 'OperationListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'OperationElementType', + type: { + name: 'Composite', + class_name: 'Operation' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_kind.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_kind.rb new file mode 100644 index 000000000..d07c76a11 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_kind.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for PartitionKind + # + module PartitionKind + Hash = "Hash" + Range = "Range" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_metric.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_metric.rb new file mode 100644 index 000000000..49d44f0df --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_metric.rb @@ -0,0 +1,124 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The metric values for a single partition. + # + class PartitionMetric < Metric + + include MsRestAzure + + # @return [String] The partition id (GUID identifier) of the metric + # values. + attr_accessor :partition_id + + # @return [String] The partition key range id (integer identifier) of the + # metric values. + attr_accessor :partition_key_range_id + + + # + # Mapper for PartitionMetric class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionMetric', + type: { + name: 'Composite', + class_name: 'PartitionMetric', + model_properties: { + start_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + end_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'endTime', + type: { + name: 'DateTime' + } + }, + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + metric_values: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricValues', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricValueElementType', + type: { + name: 'Composite', + class_name: 'MetricValue' + } + } + } + }, + partition_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionId', + type: { + name: 'String' + } + }, + partition_key_range_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionKeyRangeId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb new file mode 100644 index 000000000..43f277a00 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The response to a list partition metrics request. + # + class PartitionMetricListResult + + include MsRestAzure + + # @return [Array] The list of partition-level metrics + # for the account. + attr_accessor :value + + + # + # Mapper for PartitionMetricListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionMetricListResult', + type: { + name: 'Composite', + class_name: 'PartitionMetricListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PartitionMetricElementType', + type: { + name: 'Composite', + class_name: 'PartitionMetric' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_usage.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_usage.rb new file mode 100644 index 000000000..c29e10327 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_usage.rb @@ -0,0 +1,105 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The partition level usage data for a usage request. + # + class PartitionUsage < Usage + + include MsRestAzure + + # @return [String] The partition id (GUID identifier) of the usages. + attr_accessor :partition_id + + # @return [String] The partition key range id (integer identifier) of the + # usages. + attr_accessor :partition_key_range_id + + + # + # Mapper for PartitionUsage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionUsage', + type: { + name: 'Composite', + class_name: 'PartitionUsage', + model_properties: { + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + quota_period: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'quotaPeriod', + type: { + name: 'String' + } + }, + limit: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'limit', + type: { + name: 'Number' + } + }, + current_value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'currentValue', + type: { + name: 'Number' + } + }, + partition_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionId', + type: { + name: 'String' + } + }, + partition_key_range_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionKeyRangeId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb new file mode 100644 index 000000000..7453ad1eb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The response to a list partition level usage request. + # + class PartitionUsagesResult + + include MsRestAzure + + # @return [Array] The list of partition-level usages for + # the database. A usage is a point in time metric + attr_accessor :value + + + # + # Mapper for PartitionUsagesResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionUsagesResult', + type: { + name: 'Composite', + class_name: 'PartitionUsagesResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PartitionUsageElementType', + type: { + name: 'Composite', + class_name: 'PartitionUsage' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb new file mode 100644 index 000000000..6448891ff --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb @@ -0,0 +1,120 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Percentile Metric data + # + class PercentileMetric + + include MsRestAzure + + # @return [DateTime] The start time for the metric (ISO-8601 format). + attr_accessor :start_time + + # @return [DateTime] The end time for the metric (ISO-8601 format). + attr_accessor :end_time + + # @return [String] The time grain to be used to summarize the metric + # values. + attr_accessor :time_grain + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + # @return [Array] The percentile metric values for + # the specified time window and timestep. + attr_accessor :metric_values + + + # + # Mapper for PercentileMetric class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetric', + type: { + name: 'Composite', + class_name: 'PercentileMetric', + model_properties: { + start_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + end_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'endTime', + type: { + name: 'DateTime' + } + }, + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + metric_values: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricValues', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricValueElementType', + type: { + name: 'Composite', + class_name: 'PercentileMetricValue' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb new file mode 100644 index 000000000..4c554d91d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The response to a list percentile metrics request. + # + class PercentileMetricListResult + + include MsRestAzure + + # @return [Array] The list of percentile metrics for + # the account. + attr_accessor :value + + + # + # Mapper for PercentileMetricListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricListResult', + type: { + name: 'Composite', + class_name: 'PercentileMetricListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricElementType', + type: { + name: 'Composite', + class_name: 'PercentileMetric' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb new file mode 100644 index 000000000..d74cc8251 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb @@ -0,0 +1,173 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Represents percentile metrics values. + # + class PercentileMetricValue < MetricValue + + include MsRestAzure + + # @return [Float] The 10th percentile value for the metric. + attr_accessor :p10 + + # @return [Float] The 25th percentile value for the metric. + attr_accessor :p25 + + # @return [Float] The 50th percentile value for the metric. + attr_accessor :p50 + + # @return [Float] The 75th percentile value for the metric. + attr_accessor :p75 + + # @return [Float] The 90th percentile value for the metric. + attr_accessor :p90 + + # @return [Float] The 95th percentile value for the metric. + attr_accessor :p95 + + # @return [Float] The 99th percentile value for the metric. + attr_accessor :p99 + + + # + # Mapper for PercentileMetricValue class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricValue', + type: { + name: 'Composite', + class_name: 'PercentileMetricValue', + model_properties: { + _count: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_count', + type: { + name: 'Double' + } + }, + average: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'average', + type: { + name: 'Double' + } + }, + maximum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'maximum', + type: { + name: 'Double' + } + }, + minimum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimum', + type: { + name: 'Double' + } + }, + timestamp: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timestamp', + type: { + name: 'DateTime' + } + }, + total: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'total', + type: { + name: 'Double' + } + }, + p10: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P10', + type: { + name: 'Double' + } + }, + p25: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P25', + type: { + name: 'Double' + } + }, + p50: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P50', + type: { + name: 'Double' + } + }, + p75: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P75', + type: { + name: 'Double' + } + }, + p90: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P90', + type: { + name: 'Double' + } + }, + p95: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P95', + type: { + name: 'Double' + } + }, + p99: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P99', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb new file mode 100644 index 000000000..37b02d6b7 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for PrimaryAggregationType + # + module PrimaryAggregationType + None = "None" + Average = "Average" + Total = "Total" + Minimum = "Minimum" + Maximum = "Maximum" + Last = "Last" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/provisioned_throughput_settings_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/provisioned_throughput_settings_resource.rb new file mode 100644 index 000000000..4af6c11ec --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/provisioned_throughput_settings_resource.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB provisioned throughput settings object + # + class ProvisionedThroughputSettingsResource + + include MsRestAzure + + # @return [Integer] Represents maximum throughput container can scale up + # to. + attr_accessor :max_throughput + + # @return [AutoUpgradePolicyResource] Cosmos DB resource auto-upgrade + # policy + attr_accessor :auto_upgrade_policy + + # @return [Integer] Represents target maximum throughput container can + # scale up to once offer is no longer in pending state. + attr_accessor :target_max_throughput + + + # + # Mapper for ProvisionedThroughputSettingsResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ProvisionedThroughputSettingsResource', + type: { + name: 'Composite', + class_name: 'ProvisionedThroughputSettingsResource', + model_properties: { + max_throughput: { + client_side_validation: true, + required: true, + serialized_name: 'maxThroughput', + type: { + name: 'Number' + } + }, + auto_upgrade_policy: { + client_side_validation: true, + required: false, + serialized_name: 'autoUpgradePolicy', + type: { + name: 'Composite', + class_name: 'AutoUpgradePolicyResource' + } + }, + target_max_throughput: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'targetMaxThroughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb new file mode 100644 index 000000000..16ab7ecc1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB region to online or offline. + # + class RegionForOnlineOffline + + include MsRestAzure + + # @return [String] Cosmos DB region, with spaces between words and each + # word capitalized. + attr_accessor :region + + + # + # Mapper for RegionForOnlineOffline class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'RegionForOnlineOffline', + type: { + name: 'Composite', + class_name: 'RegionForOnlineOffline', + model_properties: { + region: { + client_side_validation: true, + required: true, + serialized_name: 'region', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb new file mode 100644 index 000000000..9087f8174 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb @@ -0,0 +1,67 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class SpatialSpec + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + # @return [Array] List of path's spatial type + attr_accessor :types + + + # + # Mapper for SpatialSpec class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SpatialSpec', + type: { + name: 'Composite', + class_name: 'SpatialSpec', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + types: { + client_side_validation: true, + required: false, + serialized_name: 'types', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SpatialTypeElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/spatial_type.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/spatial_type.rb new file mode 100644 index 000000000..bc7b28773 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/spatial_type.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for SpatialType + # + module SpatialType + Point = "Point" + LineString = "LineString" + Polygon = "Polygon" + MultiPolygon = "MultiPolygon" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb new file mode 100644 index 000000000..c6370dc1b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB container. + # + class SqlContainerCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlContainerResource] The standard JSON format of a container + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlContainerCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlContainerCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlContainerResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb new file mode 100644 index 000000000..33740ebb9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb @@ -0,0 +1,150 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class SqlContainerGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL container + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # container + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the container. + attr_accessor :conflict_resolution_policy + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlContainerGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlContainerGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb new file mode 100644 index 000000000..8fb279f62 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB container. + # + class SqlContainerGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlContainerGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for SqlContainerGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerGetResults', + type: { + name: 'Composite', + class_name: 'SqlContainerGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlContainerGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb new file mode 100644 index 000000000..443e6c5c2 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the containers and their + # properties. + # + class SqlContainerListResult + + include MsRestAzure + + # @return [Array] List of containers and their + # properties. + attr_accessor :value + + + # + # Mapper for SqlContainerListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerListResult', + type: { + name: 'Composite', + class_name: 'SqlContainerListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlContainerGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb new file mode 100644 index 000000000..764c6d441 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB SQL container resource object + # + class SqlContainerResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL container + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # container + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the container. + attr_accessor :conflict_resolution_policy + + + # + # Mapper for SqlContainerResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerResource', + type: { + name: 'Composite', + class_name: 'SqlContainerResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb new file mode 100644 index 000000000..8d947dde5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB SQL database. + # + class SqlDatabaseCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlDatabaseResource] The standard JSON format of a SQL + # database + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlDatabaseCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlDatabaseCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb new file mode 100644 index 000000000..ea690a2a6 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb @@ -0,0 +1,109 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class SqlDatabaseGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL database + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + # @return [String] A system generated property that specified the + # addressable path of the collections resource. + attr_accessor :_colls + + # @return [String] A system generated property that specifies the + # addressable path of the users resource. + attr_accessor :_users + + + # + # Mapper for SqlDatabaseGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + }, + _colls: { + client_side_validation: true, + required: false, + serialized_name: '_colls', + type: { + name: 'String' + } + }, + _users: { + client_side_validation: true, + required: false, + serialized_name: '_users', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb new file mode 100644 index 000000000..4ad3a543d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB SQL database. + # + class SqlDatabaseGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlDatabaseGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for SqlDatabaseGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseGetResults', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb new file mode 100644 index 000000000..c66b95e44 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the SQL databases and their + # properties. + # + class SqlDatabaseListResult + + include MsRestAzure + + # @return [Array] List of SQL databases and their + # properties. + attr_accessor :value + + + # + # Mapper for SqlDatabaseListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseListResult', + type: { + name: 'Composite', + class_name: 'SqlDatabaseListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb new file mode 100644 index 000000000..aa216611f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB SQL database resource object + # + class SqlDatabaseResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL database + attr_accessor :id + + + # + # Mapper for SqlDatabaseResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseResource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb new file mode 100644 index 000000000..bee4ec3a5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB storedProcedure. + # + class SqlStoredProcedureCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlStoredProcedureResource] The standard JSON format of a + # storedProcedure + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlStoredProcedureCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb new file mode 100644 index 000000000..c38a69f43 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class SqlStoredProcedureGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL storedProcedure + attr_accessor :id + + # @return [String] Body of the Stored Procedure + attr_accessor :body + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlStoredProcedureGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb new file mode 100644 index 000000000..900238ddc --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB storedProcedure. + # + class SqlStoredProcedureGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlStoredProcedureGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for SqlStoredProcedureGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureGetResults', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb new file mode 100644 index 000000000..615c2aa3f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the storedProcedures and their + # properties. + # + class SqlStoredProcedureListResult + + include MsRestAzure + + # @return [Array] List of storedProcedures + # and their properties. + attr_accessor :value + + + # + # Mapper for SqlStoredProcedureListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureListResult', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb new file mode 100644 index 000000000..97fdb5afa --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB SQL storedProcedure resource object + # + class SqlStoredProcedureResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL storedProcedure + attr_accessor :id + + # @return [String] Body of the Stored Procedure + attr_accessor :body + + + # + # Mapper for SqlStoredProcedureResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureResource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb new file mode 100644 index 000000000..5df7a9800 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB trigger. + # + class SqlTriggerCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlTriggerResource] The standard JSON format of a trigger + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlTriggerCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlTriggerCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlTriggerResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb new file mode 100644 index 000000000..d43397b00 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb @@ -0,0 +1,121 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class SqlTriggerGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL trigger + attr_accessor :id + + # @return [String] Body of the Trigger + attr_accessor :body + + # @return [TriggerType] Type of the Trigger. Possible values include: + # 'Pre', 'Post' + attr_accessor :trigger_type + + # @return [TriggerOperation] The operation the trigger is associated + # with. Possible values include: 'All', 'Create', 'Update', 'Delete', + # 'Replace' + attr_accessor :trigger_operation + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlTriggerGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + trigger_type: { + client_side_validation: true, + required: false, + serialized_name: 'triggerType', + type: { + name: 'String' + } + }, + trigger_operation: { + client_side_validation: true, + required: false, + serialized_name: 'triggerOperation', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb new file mode 100644 index 000000000..a51784505 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB trigger. + # + class SqlTriggerGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlTriggerGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for SqlTriggerGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerGetResults', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb new file mode 100644 index 000000000..569e9c133 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the triggers and their + # properties. + # + class SqlTriggerListResult + + include MsRestAzure + + # @return [Array] List of triggers and their + # properties. + attr_accessor :value + + + # + # Mapper for SqlTriggerListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerListResult', + type: { + name: 'Composite', + class_name: 'SqlTriggerListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb new file mode 100644 index 000000000..fc9261d6a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb @@ -0,0 +1,82 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB SQL trigger resource object + # + class SqlTriggerResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL trigger + attr_accessor :id + + # @return [String] Body of the Trigger + attr_accessor :body + + # @return [TriggerType] Type of the Trigger. Possible values include: + # 'Pre', 'Post' + attr_accessor :trigger_type + + # @return [TriggerOperation] The operation the trigger is associated + # with. Possible values include: 'All', 'Create', 'Update', 'Delete', + # 'Replace' + attr_accessor :trigger_operation + + + # + # Mapper for SqlTriggerResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerResource', + type: { + name: 'Composite', + class_name: 'SqlTriggerResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + trigger_type: { + client_side_validation: true, + required: false, + serialized_name: 'triggerType', + type: { + name: 'String' + } + }, + trigger_operation: { + client_side_validation: true, + required: false, + serialized_name: 'triggerOperation', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb new file mode 100644 index 000000000..bbbf5c0af --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb @@ -0,0 +1,113 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB userDefinedFunction. + # + class SqlUserDefinedFunctionCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlUserDefinedFunctionResource] The standard JSON format of a + # userDefinedFunction + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlUserDefinedFunctionCreateUpdateParameters class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb new file mode 100644 index 000000000..c6673367b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class SqlUserDefinedFunctionGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL userDefinedFunction + attr_accessor :id + + # @return [String] Body of the User Defined Function + attr_accessor :body + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlUserDefinedFunctionGetPropertiesResource class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb new file mode 100644 index 000000000..541bdd206 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB userDefinedFunction. + # + class SqlUserDefinedFunctionGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlUserDefinedFunctionGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for SqlUserDefinedFunctionGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionGetResults', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb new file mode 100644 index 000000000..a6a856ced --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the userDefinedFunctions and + # their properties. + # + class SqlUserDefinedFunctionListResult + + include MsRestAzure + + # @return [Array] List of + # userDefinedFunctions and their properties. + attr_accessor :value + + + # + # Mapper for SqlUserDefinedFunctionListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionListResult', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb new file mode 100644 index 000000000..4636e6514 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB SQL userDefinedFunction resource object + # + class SqlUserDefinedFunctionResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL userDefinedFunction + attr_accessor :id + + # @return [String] Body of the User Defined Function + attr_accessor :body + + + # + # Mapper for SqlUserDefinedFunctionResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionResource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb new file mode 100644 index 000000000..e9bffeb88 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to create and update Cosmos DB Table. + # + class TableCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [TableResource] The standard JSON format of a Table + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for TableCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'TableCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'TableResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb new file mode 100644 index 000000000..847006332 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class TableGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB table + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for TableGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableGetProperties_resource', + type: { + name: 'Composite', + class_name: 'TableGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_get_results.rb new file mode 100644 index 000000000..7a4b0f054 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB Table. + # + class TableGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [TableGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for TableGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableGetResults', + type: { + name: 'Composite', + class_name: 'TableGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'TableGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_list_result.rb new file mode 100644 index 000000000..bf95d9e09 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The List operation response, that contains the Table and their + # properties. + # + class TableListResult + + include MsRestAzure + + # @return [Array] List of Table and their properties. + attr_accessor :value + + + # + # Mapper for TableListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableListResult', + type: { + name: 'Composite', + class_name: 'TableListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TableGetResultsElementType', + type: { + name: 'Composite', + class_name: 'TableGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_resource.rb new file mode 100644 index 000000000..822361258 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/table_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB table resource object + # + class TableResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB table + attr_accessor :id + + + # + # Mapper for TableResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableResource', + type: { + name: 'Composite', + class_name: 'TableResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb new file mode 100644 index 000000000..faebc60f5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB resource throughput policy + # + class ThroughputPolicyResource + + include MsRestAzure + + # @return [Boolean] Determines whether the ThroughputPolicy is active or + # not + attr_accessor :is_enabled + + # @return [Integer] Represents the percentage by which throughput can + # increase every time throughput policy kicks in. + attr_accessor :increment_percent + + + # + # Mapper for ThroughputPolicyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputPolicyResource', + type: { + name: 'Composite', + class_name: 'ThroughputPolicyResource', + model_properties: { + is_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'isEnabled', + type: { + name: 'Boolean' + } + }, + increment_percent: { + client_side_validation: true, + required: false, + serialized_name: 'incrementPercent', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb new file mode 100644 index 000000000..09e93ddab --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb @@ -0,0 +1,125 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Model object. + # + # + class ThroughputSettingsGetPropertiesResource + + include MsRestAzure + + # @return [Integer] Value of the Cosmos DB resource throughput. Either + # throughput is required or provisionedThroughputSettings is required, + # but not both. + attr_accessor :throughput + + # @return [ProvisionedThroughputSettingsResource] Cosmos DB resource for + # provisioned throughput settings. Either throughput is required or + # provisionedThroughputSettings is required, but not both. + attr_accessor :provisioned_throughput_settings + + # @return [String] The minimum throughput of the resource + attr_accessor :minimum_throughput + + # @return [String] The throughput replace is pending + attr_accessor :offer_replace_pending + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for ThroughputSettingsGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsGetProperties_resource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsGetPropertiesResource', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + provisioned_throughput_settings: { + client_side_validation: true, + required: false, + serialized_name: 'provisionedThroughputSettings', + type: { + name: 'Composite', + class_name: 'ProvisionedThroughputSettingsResource' + } + }, + minimum_throughput: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimumThroughput', + type: { + name: 'String' + } + }, + offer_replace_pending: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'offerReplacePending', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb new file mode 100644 index 000000000..1000195fe --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # An Azure Cosmos DB resource throughput. + # + class ThroughputSettingsGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [ThroughputSettingsGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for ThroughputSettingsGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsGetResults', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb new file mode 100644 index 000000000..a0abd162a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb @@ -0,0 +1,87 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Cosmos DB resource throughput object. Either throughput is required or + # provisionedThroughputSettings is required, but not both. + # + class ThroughputSettingsResource + + include MsRestAzure + + # @return [Integer] Value of the Cosmos DB resource throughput. Either + # throughput is required or provisionedThroughputSettings is required, + # but not both. + attr_accessor :throughput + + # @return [ProvisionedThroughputSettingsResource] Cosmos DB resource for + # provisioned throughput settings. Either throughput is required or + # provisionedThroughputSettings is required, but not both. + attr_accessor :provisioned_throughput_settings + + # @return [String] The minimum throughput of the resource + attr_accessor :minimum_throughput + + # @return [String] The throughput replace is pending + attr_accessor :offer_replace_pending + + + # + # Mapper for ThroughputSettingsResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsResource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsResource', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + provisioned_throughput_settings: { + client_side_validation: true, + required: false, + serialized_name: 'provisionedThroughputSettings', + type: { + name: 'Composite', + class_name: 'ProvisionedThroughputSettingsResource' + } + }, + minimum_throughput: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimumThroughput', + type: { + name: 'String' + } + }, + offer_replace_pending: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'offerReplacePending', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb new file mode 100644 index 000000000..7b38f3b41 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb @@ -0,0 +1,99 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Parameters to update Cosmos DB resource throughput. + # + class ThroughputSettingsUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [ThroughputSettingsResource] The standard JSON format of a + # resource throughput + attr_accessor :resource + + + # + # Mapper for ThroughputSettingsUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsUpdateParameters', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb new file mode 100644 index 000000000..218eccc56 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for TriggerOperation + # + module TriggerOperation + All = "All" + Create = "Create" + Update = "Update" + Delete = "Delete" + Replace = "Replace" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/trigger_type.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/trigger_type.rb new file mode 100644 index 000000000..f2ac5a57a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/trigger_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for TriggerType + # + module TriggerType + Pre = "Pre" + Post = "Post" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unique_key.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unique_key.rb new file mode 100644 index 000000000..1b7e72650 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unique_key.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The unique key on that enforces uniqueness constraint on documents in the + # collection in the Azure Cosmos DB service. + # + class UniqueKey + + include MsRestAzure + + # @return [Array] List of paths must be unique for each document + # in the Azure Cosmos DB service + attr_accessor :paths + + + # + # Mapper for UniqueKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UniqueKey', + type: { + name: 'Composite', + class_name: 'UniqueKey', + model_properties: { + paths: { + client_side_validation: true, + required: false, + serialized_name: 'paths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb new file mode 100644 index 000000000..e108b7c91 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The unique key policy configuration for specifying uniqueness constraints + # on documents in the collection in the Azure Cosmos DB service. + # + class UniqueKeyPolicy + + include MsRestAzure + + # @return [Array] List of unique keys on that enforces + # uniqueness constraint on documents in the collection in the Azure + # Cosmos DB service. + attr_accessor :unique_keys + + + # + # Mapper for UniqueKeyPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy', + model_properties: { + unique_keys: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'UniqueKeyElementType', + type: { + name: 'Composite', + class_name: 'UniqueKey' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unit_type.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unit_type.rb new file mode 100644 index 000000000..b0c9568f7 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/unit_type.rb @@ -0,0 +1,21 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Defines values for UnitType + # + module UnitType + Count = "Count" + Bytes = "Bytes" + Seconds = "Seconds" + Percent = "Percent" + CountPerSecond = "CountPerSecond" + BytesPerSecond = "BytesPerSecond" + Milliseconds = "Milliseconds" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/usage.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/usage.rb new file mode 100644 index 000000000..bef295375 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/usage.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The usage data for a usage request. + # + class Usage + + include MsRestAzure + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + # @return [String] The quota period used to summarize the usage values. + attr_accessor :quota_period + + # @return [Integer] Maximum value for this metric + attr_accessor :limit + + # @return [Integer] Current value for this metric + attr_accessor :current_value + + + # + # Mapper for Usage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Usage', + type: { + name: 'Composite', + class_name: 'Usage', + model_properties: { + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + quota_period: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'quotaPeriod', + type: { + name: 'String' + } + }, + limit: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'limit', + type: { + name: 'Number' + } + }, + current_value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'currentValue', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/usages_result.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/usages_result.rb new file mode 100644 index 000000000..023c14cf8 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/usages_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # The response to a list usage request. + # + class UsagesResult + + include MsRestAzure + + # @return [Array] The list of usages for the database. A usage is + # a point in time metric + attr_accessor :value + + + # + # Mapper for UsagesResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UsagesResult', + type: { + name: 'Composite', + class_name: 'UsagesResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'UsageElementType', + type: { + name: 'Composite', + class_name: 'Usage' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb new file mode 100644 index 000000000..f15cb7c3b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + module Models + # + # Virtual Network ACL Rule object + # + class VirtualNetworkRule + + include MsRestAzure + + # @return [String] Resource ID of a subnet, for example: + # /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + attr_accessor :id + + # @return [Boolean] Create firewall rule before the virtual network has + # vnet service endpoint enabled. + attr_accessor :ignore_missing_vnet_service_endpoint + + + # + # Mapper for VirtualNetworkRule class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRule', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + ignore_missing_vnet_service_endpoint: { + client_side_validation: true, + required: false, + serialized_name: 'ignoreMissingVNetServiceEndpoint', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/module_definition.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/module_definition.rb new file mode 100644 index 000000000..8b8c3399f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/module_definition.rb @@ -0,0 +1,9 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::Cosmosdb end +module Azure::Cosmosdb::Mgmt end +module Azure::Cosmosdb::Mgmt::V2019_12_12 end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb new file mode 100644 index 000000000..356651cf9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb @@ -0,0 +1,1634 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class MongoDBResources + include MsRestAzure + + # + # Creates and initializes a new instance of the MongoDBResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the MongoDB databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseListResult] operation results. + # + def list_mongo_dbdatabases(resource_group_name, account_name, custom_headers:nil) + response = list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the MongoDB databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_mongo_dbdatabases_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the MongoDB databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MongoDBDatabaseListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the MongoDB databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseGetResults] operation results. + # + def get_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the MongoDB databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the MongoDB databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MongoDBDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseGetResults] operation results. + # + def create_update_mongo_dbdatabase(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + response = create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MongoDBDatabaseGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) + response = delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) + # Send request + promise = begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the MongoDB database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the MongoDB database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbdatabase_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the MongoDB database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionListResult] operation results. + # + def list_mongo_dbcollections(resource_group_name, account_name, database_name, custom_headers:nil) + response = list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_mongo_dbcollections_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Lists the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MongoDBCollectionListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionGetResults] operation results. + # + def get_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + end + + # + # Gets the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MongoDBCollectionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionGetResults] operation results. + # + def create_update_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + response = create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MongoDBCollectionGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + # Send request + promise = begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the MongoDB collection under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the MongoDB collection under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbcollection_throughput_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the MongoDB collection under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + response = update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseGetResults] operation results. + # + def begin_create_update_mongo_dbdatabase(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + response = begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_mongo_dbdatabase_parameters is nil' if create_update_mongo_dbdatabase_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MongoDBDatabaseCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_mongo_dbdatabase_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MongoDBDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) + response = begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_mongo_dbdatabase_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionGetResults] operation results. + # + def begin_create_update_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + response = begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_mongo_dbcollection_parameters is nil' if create_update_mongo_dbcollection_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MongoDBCollectionCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_mongo_dbcollection_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::MongoDBCollectionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_mongo_dbcollection_throughput_with_http_info(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb new file mode 100644 index 000000000..36ba9dc6e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb @@ -0,0 +1,907 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class NotebookWorkspaces + include MsRestAzure + + # + # Creates and initializes a new instance of the NotebookWorkspaces class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Gets the notebook workspace resources of an existing Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspaceListResult] operation results. + # + def list_by_database_account(resource_group_name, account_name, custom_headers:nil) + response = list_by_database_account_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the notebook workspace resources of an existing Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_database_account_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_by_database_account_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Gets the notebook workspace resources of an existing Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_database_account_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::NotebookWorkspaceListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspace] operation results. + # + def get(resource_group_name, account_name, custom_headers:nil) + response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, account_name, custom_headers:nil) + get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Gets the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::NotebookWorkspace.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspace] operation results. + # + def create_or_update(resource_group_name, account_name, custom_headers:nil) + response = create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::NotebookWorkspace.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, account_name, custom_headers:nil) + response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Retrieves the connection info for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspaceConnectionInfoResult] operation results. + # + def list_connection_info(resource_group_name, account_name, custom_headers:nil) + response = list_connection_info_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the connection info for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_connection_info_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_connection_info_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Retrieves the connection info for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_connection_info_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::NotebookWorkspaceConnectionInfoResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def regenerate_auth_token(resource_group_name, account_name, custom_headers:nil) + response = regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def regenerate_auth_token_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def start(resource_group_name, account_name, custom_headers:nil) + response = start_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def start_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_start_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspace] operation results. + # + def begin_create_or_update(resource_group_name, account_name, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + notebook_create_update_parameters = NotebookWorkspaceCreateUpdateParameters.new + unless + end + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::NotebookWorkspaceCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, notebook_create_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::NotebookWorkspace.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, account_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_regenerate_auth_token(resource_group_name, account_name, custom_headers:nil) + response = begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_regenerate_auth_token_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_start(resource_group_name, account_name, custom_headers:nil) + response = begin_start_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_start_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_start_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_start_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/operations.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/operations.rb new file mode 100644 index 000000000..ef80f4676 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/operations.rb @@ -0,0 +1,219 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Operations + include MsRestAzure + + # + # Creates and initializes a new instance of the Operations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers:nil) + first_page = list_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.DocumentDB/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::OperationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::OperationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb new file mode 100644 index 000000000..b658fce39 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb @@ -0,0 +1,156 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PartitionKeyRangeId + include MsRestAzure + + # + # Creates and initializes a new instance of the PartitionKeyRangeId class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, 'partition_key_range_id is nil' if partition_key_range_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid,'partitionKeyRangeId' => partition_key_range_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb new file mode 100644 index 000000000..3291c104b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb @@ -0,0 +1,163 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PartitionKeyRangeIdRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the PartitionKeyRangeIdRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id and region. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id and region. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id and region. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, 'partition_key_range_id is nil' if partition_key_range_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region,'databaseRid' => database_rid,'collectionRid' => collection_rid,'partitionKeyRangeId' => partition_key_range_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile.rb new file mode 100644 index 000000000..3b4c6f942 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile.rb @@ -0,0 +1,141 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Percentile + include MsRestAzure + + # + # Creates and initializes a new instance of the Percentile class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PercentileMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::PercentileMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile_source_target.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile_source_target.rb new file mode 100644 index 000000000..5a593839b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile_source_target.rb @@ -0,0 +1,158 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PercentileSourceTarget + include MsRestAzure + + # + # Creates and initializes a new instance of the PercentileSourceTarget class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given account, + # source and target region. This url is only for PBS and Replication Latency + # data + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param source_region [String] Source region from which data is written. + # Cosmos DB region, with spaces between words and each word capitalized. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PercentileMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, source_region, target_region, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, source_region, target_region, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given account, + # source and target region. This url is only for PBS and Replication Latency + # data + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param source_region [String] Source region from which data is written. + # Cosmos DB region, with spaces between words and each word capitalized. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, source_region, target_region, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, source_region, target_region, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given account, + # source and target region. This url is only for PBS and Replication Latency + # data + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param source_region [String] Source region from which data is written. + # Cosmos DB region, with spaces between words and each word capitalized. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, source_region, target_region, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'source_region is nil' if source_region.nil? + fail ArgumentError, 'target_region is nil' if target_region.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'sourceRegion' => source_region,'targetRegion' => target_region}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::PercentileMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile_target.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile_target.rb new file mode 100644 index 000000000..3c47f4f40 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/percentile_target.rb @@ -0,0 +1,148 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PercentileTarget + include MsRestAzure + + # + # Creates and initializes a new instance of the PercentileTarget class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given account + # target region. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PercentileMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, target_region, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, target_region, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given account + # target region. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, target_region, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, target_region, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given account + # target region. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, target_region, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'target_region is nil' if target_region.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'targetRegion' => target_region}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::PercentileMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb new file mode 100644 index 000000000..97fa0a667 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb @@ -0,0 +1,3289 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class SqlResources + include MsRestAzure + + # + # Creates and initializes a new instance of the SqlResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the SQL databases under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseListResult] operation results. + # + def list_sql_databases(resource_group_name, account_name, custom_headers:nil) + response = list_sql_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL databases under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_databases_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_sql_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL databases under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_databases_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlDatabaseListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL database under an existing Azure Cosmos DB database account with + # the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseGetResults] operation results. + # + def get_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL database under an existing Azure Cosmos DB database account with + # the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL database under an existing Azure Cosmos DB database account with + # the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseGetResults] operation results. + # + def create_update_sql_database(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + response = create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlDatabaseGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the SQL database under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_sql_database_throughput(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the SQL database under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_database_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the SQL database under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_sql_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerListResult] operation results. + # + def list_sql_containers(resource_group_name, account_name, database_name, custom_headers:nil) + response = list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_containers_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlContainerListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerGetResults] operation results. + # + def get_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlContainerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerGetResults] operation results. + # + def create_update_sql_container(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + response = create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlContainerGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the SQL container under an existing Azure Cosmos + # DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_sql_container_throughput(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the SQL container under an existing Azure Cosmos + # DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_container_throughput_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the SQL container under an existing Azure Cosmos + # DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_sql_container_throughput(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + response = update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureListResult] operation results. + # + def list_sql_stored_procedures(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = list_sql_stored_procedures_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_stored_procedures_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + list_sql_stored_procedures_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_stored_procedures_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlStoredProcedureListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureGetResults] operation results. + # + def get_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + response = get_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + get_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'stored_procedure_name is nil' if stored_procedure_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlStoredProcedureGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureGetResults] operation results. + # + def create_update_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + response = create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlStoredProcedureGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + response = delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionListResult] operation results. + # + def list_sql_user_defined_functions(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = list_sql_user_defined_functions_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_user_defined_functions_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + list_sql_user_defined_functions_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_user_defined_functions_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlUserDefinedFunctionListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionGetResults] operation results. + # + def get_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + response = get_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + get_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'user_defined_function_name is nil' if user_defined_function_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlUserDefinedFunctionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionGetResults] operation results. + # + def create_update_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + response = create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlUserDefinedFunctionGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + response = delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerListResult] operation results. + # + def list_sql_triggers(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = list_sql_triggers_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_triggers_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + list_sql_triggers_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_triggers_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlTriggerListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerGetResults] operation results. + # + def get_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + response = get_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + get_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'trigger_name is nil' if trigger_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlTriggerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerGetResults] operation results. + # + def create_update_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + response = create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlTriggerGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + response = delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseGetResults] operation results. + # + def begin_create_update_sql_database(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + response = begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_database_with_http_info(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_sql_database_parameters is nil' if create_update_sql_database_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlDatabaseCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_database_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_sql_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_sql_database_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerGetResults] operation results. + # + def begin_create_update_sql_container(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + response = begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_sql_container_parameters is nil' if create_update_sql_container_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlContainerCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_container_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlContainerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_sql_container_throughput(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_sql_container_throughput_with_http_info(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureGetResults] operation results. + # + def begin_create_update_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + response = begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'stored_procedure_name is nil' if stored_procedure_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_sql_stored_procedure_parameters is nil' if create_update_sql_stored_procedure_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlStoredProcedureCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_stored_procedure_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlStoredProcedureGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + response = begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'stored_procedure_name is nil' if stored_procedure_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionGetResults] operation results. + # + def begin_create_update_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + response = begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'user_defined_function_name is nil' if user_defined_function_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_sql_user_defined_function_parameters is nil' if create_update_sql_user_defined_function_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlUserDefinedFunctionCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_user_defined_function_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlUserDefinedFunctionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + response = begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'user_defined_function_name is nil' if user_defined_function_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerGetResults] operation results. + # + def begin_create_update_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + response = begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'trigger_name is nil' if trigger_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_sql_trigger_parameters is nil' if create_update_sql_trigger_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlTriggerCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_trigger_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlTriggerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + response = begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'trigger_name is nil' if trigger_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/table_resources.rb b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/table_resources.rb new file mode 100644 index 000000000..d6ca1d1cb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2019-12-12/generated/azure_mgmt_cosmosdb/table_resources.rb @@ -0,0 +1,804 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2019_12_12 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class TableResources + include MsRestAzure + + # + # Creates and initializes a new instance of the TableResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the Tables under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableListResult] operation results. + # + def list_tables(resource_group_name, account_name, custom_headers:nil) + response = list_tables_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Tables under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_tables_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_tables_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the Tables under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_tables_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::TableListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Tables under an existing Azure Cosmos DB database account with the + # provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableGetResults] operation results. + # + def get_table(resource_group_name, account_name, table_name, custom_headers:nil) + response = get_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Tables under an existing Azure Cosmos DB database account with the + # provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_table_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) + get_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the Tables under an existing Azure Cosmos DB database account with the + # provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_table_async(resource_group_name, account_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::TableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableGetResults] operation results. + # + def create_update_table(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + response = create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::TableGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_table(resource_group_name, account_name, table_name, custom_headers:nil) + response = delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_table_async(resource_group_name, account_name, table_name, custom_headers:nil) + # Send request + promise = begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Table under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_table_throughput(resource_group_name, account_name, table_name, custom_headers:nil) + response = get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Table under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_table_throughput_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) + get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Table under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_table_throughput(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + response = update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableGetResults] operation results. + # + def begin_create_update_table(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + response = begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_table_with_http_info(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'create_update_table_parameters is nil' if create_update_table_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::TableCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_table_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::TableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_table(resource_group_name, account_name, table_name, custom_headers:nil) + response = begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_table_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) + begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_table_throughput(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_table_throughput_with_http_info(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] Name of an Azure resource group. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb.rb new file mode 100644 index 000000000..2dd62aadb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb.rb @@ -0,0 +1,208 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require '2020-03-01/generated/azure_mgmt_cosmosdb/module_definition' +require 'ms_rest_azure' + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + autoload :DatabaseAccounts, '2020-03-01/generated/azure_mgmt_cosmosdb/database_accounts.rb' + autoload :Operations, '2020-03-01/generated/azure_mgmt_cosmosdb/operations.rb' + autoload :Database, '2020-03-01/generated/azure_mgmt_cosmosdb/database.rb' + autoload :Collection, '2020-03-01/generated/azure_mgmt_cosmosdb/collection.rb' + autoload :CollectionRegion, '2020-03-01/generated/azure_mgmt_cosmosdb/collection_region.rb' + autoload :DatabaseAccountRegion, '2020-03-01/generated/azure_mgmt_cosmosdb/database_account_region.rb' + autoload :PercentileSourceTarget, '2020-03-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb' + autoload :PercentileTarget, '2020-03-01/generated/azure_mgmt_cosmosdb/percentile_target.rb' + autoload :Percentile, '2020-03-01/generated/azure_mgmt_cosmosdb/percentile.rb' + autoload :CollectionPartitionRegion, '2020-03-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb' + autoload :CollectionPartition, '2020-03-01/generated/azure_mgmt_cosmosdb/collection_partition.rb' + autoload :PartitionKeyRangeId, '2020-03-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb' + autoload :PartitionKeyRangeIdRegion, '2020-03-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb' + autoload :SqlResources, '2020-03-01/generated/azure_mgmt_cosmosdb/sql_resources.rb' + autoload :MongoDBResources, '2020-03-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb' + autoload :TableResources, '2020-03-01/generated/azure_mgmt_cosmosdb/table_resources.rb' + autoload :CassandraResources, '2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb' + autoload :GremlinResources, '2020-03-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb' + autoload :NotebookWorkspaces, '2020-03-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb' + autoload :CosmosDBManagementClient, '2020-03-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb' + + module Models + autoload :ErrorResponse, '2020-03-01/generated/azure_mgmt_cosmosdb/models/error_response.rb' + autoload :FailoverPolicies, '2020-03-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb' + autoload :Capability, '2020-03-01/generated/azure_mgmt_cosmosdb/models/capability.rb' + autoload :RegionForOnlineOffline, '2020-03-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb' + autoload :FailoverPolicy, '2020-03-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb' + autoload :ARMResourceProperties, '2020-03-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb' + autoload :PrivateEndpointProperty, '2020-03-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb' + autoload :ARMProxyResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb' + autoload :PartitionUsagesResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb' + autoload :UsagesResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb' + autoload :DatabaseAccountsListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb' + autoload :CassandraKeyspaceListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb' + autoload :NotebookWorkspaceConnectionInfoResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb' + autoload :Column, '2020-03-01/generated/azure_mgmt_cosmosdb/models/column.rb' + autoload :SqlDatabaseListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb' + autoload :CassandraPartitionKey, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb' + autoload :IncludedPath, '2020-03-01/generated/azure_mgmt_cosmosdb/models/included_path.rb' + autoload :ClusterKey, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb' + autoload :CompositePath, '2020-03-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb' + autoload :CassandraSchema, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb' + autoload :IndexingPolicy, '2020-03-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb' + autoload :CassandraTableGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb' + autoload :UniqueKey, '2020-03-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb' + autoload :Usage, '2020-03-01/generated/azure_mgmt_cosmosdb/models/usage.rb' + autoload :ConflictResolutionPolicy, '2020-03-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb' + autoload :MetricName, '2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb' + autoload :SqlUserDefinedFunctionResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb' + autoload :Resource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/resource.rb' + autoload :CassandraTableListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb' + autoload :SqlStoredProcedureGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb' + autoload :GremlinDatabaseGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb' + autoload :SqlStoredProcedureListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb' + autoload :OperationListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb' + autoload :PercentileMetricListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb' + autoload :Operation, '2020-03-01/generated/azure_mgmt_cosmosdb/models/operation.rb' + autoload :SqlTriggerGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb' + autoload :GremlinDatabaseListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb' + autoload :SqlTriggerListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb' + autoload :GremlinGraphGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb' + autoload :MetricListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb' + autoload :OperationDisplay, '2020-03-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb' + autoload :MongoDBDatabaseListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb' + autoload :OptionsResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb' + autoload :MongoIndexOptions, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb' + autoload :GremlinGraphListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb' + autoload :MongoDBCollectionGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb' + autoload :ConsistencyPolicy, '2020-03-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb' + autoload :MetricDefinitionsListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb' + autoload :Location, '2020-03-01/generated/azure_mgmt_cosmosdb/models/location.rb' + autoload :TableGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb' + autoload :VirtualNetworkRule, '2020-03-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb' + autoload :MetricAvailability, '2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb' + autoload :PrivateLinkServiceConnectionStateProperty, '2020-03-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb' + autoload :CassandraKeyspaceGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb' + autoload :GremlinGraphResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb' + autoload :SqlDatabaseGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb' + autoload :ExtendedResourceProperties, '2020-03-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb' + autoload :Indexes, '2020-03-01/generated/azure_mgmt_cosmosdb/models/indexes.rb' + autoload :ThroughputPolicyResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb' + autoload :SpatialSpec, '2020-03-01/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb' + autoload :AutoUpgradePolicyResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb' + autoload :UniqueKeyPolicy, '2020-03-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb' + autoload :ProvisionedThroughputSettingsResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/provisioned_throughput_settings_resource.rb' + autoload :SqlContainerListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb' + autoload :ThroughputSettingsGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb' + autoload :SqlUserDefinedFunctionGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb' + autoload :GremlinDatabaseResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb' + autoload :PercentileMetric, '2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb' + autoload :CassandraTableResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb' + autoload :Metric, '2020-03-01/generated/azure_mgmt_cosmosdb/models/metric.rb' + autoload :DatabaseAccountUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb' + autoload :MongoIndex, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb' + autoload :DatabaseAccountListReadOnlyKeysResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb' + autoload :MongoDBCollectionListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb' + autoload :CassandraKeyspaceResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb' + autoload :TableListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb' + autoload :DatabaseAccountConnectionString, '2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb' + autoload :NotebookWorkspaceListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb' + autoload :DatabaseAccountListConnectionStringsResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb' + autoload :ContainerPartitionKey, '2020-03-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb' + autoload :DatabaseAccountRegenerateKeyParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb' + autoload :PartitionMetricListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb' + autoload :ThroughputSettingsResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb' + autoload :MongoDBDatabaseGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb' + autoload :TableResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb' + autoload :MetricValue, '2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb' + autoload :SqlDatabaseResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb' + autoload :CreateUpdateOptions, '2020-03-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb' + autoload :SqlContainerGetPropertiesResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb' + autoload :MongoDBCollectionResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb' + autoload :MongoIndexKeys, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb' + autoload :SqlContainerResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb' + autoload :ExcludedPath, '2020-03-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb' + autoload :MongoDBDatabaseResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb' + autoload :MetricDefinition, '2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb' + autoload :SqlStoredProcedureResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb' + autoload :SqlUserDefinedFunctionListResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb' + autoload :SqlTriggerResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb' + autoload :ProxyResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb' + autoload :PrivateEndpointConnection, '2020-03-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb' + autoload :DatabaseAccountGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb' + autoload :SqlDatabaseGetPropertiesOptions, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb' + autoload :SqlDatabaseGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb' + autoload :SqlContainerGetPropertiesOptions, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb' + autoload :SqlContainerGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb' + autoload :SqlStoredProcedureGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb' + autoload :SqlUserDefinedFunctionGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb' + autoload :SqlTriggerGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb' + autoload :MongoDBDatabaseGetPropertiesOptions, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb' + autoload :MongoDBDatabaseGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb' + autoload :MongoDBCollectionGetPropertiesOptions, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb' + autoload :MongoDBCollectionGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb' + autoload :TableGetPropertiesOptions, '2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb' + autoload :TableGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb' + autoload :CassandraKeyspaceGetPropertiesOptions, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb' + autoload :CassandraKeyspaceGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb' + autoload :CassandraTableGetPropertiesOptions, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb' + autoload :CassandraTableGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb' + autoload :GremlinDatabaseGetPropertiesOptions, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb' + autoload :GremlinDatabaseGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb' + autoload :GremlinGraphGetPropertiesOptions, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb' + autoload :GremlinGraphGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb' + autoload :ThroughputSettingsGetResults, '2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb' + autoload :DatabaseAccountCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb' + autoload :DatabaseAccountListKeysResult, '2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb' + autoload :ThroughputSettingsUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb' + autoload :SqlDatabaseCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb' + autoload :SqlContainerCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb' + autoload :SqlStoredProcedureCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb' + autoload :SqlUserDefinedFunctionCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb' + autoload :SqlTriggerCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb' + autoload :MongoDBDatabaseCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb' + autoload :MongoDBCollectionCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb' + autoload :TableCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb' + autoload :CassandraKeyspaceCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb' + autoload :CassandraTableCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb' + autoload :GremlinDatabaseCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb' + autoload :GremlinGraphCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb' + autoload :PartitionUsage, '2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb' + autoload :PercentileMetricValue, '2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb' + autoload :PartitionMetric, '2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb' + autoload :TrackedResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb' + autoload :AzureEntityResource, '2020-03-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb' + autoload :NotebookWorkspaceCreateUpdateParameters, '2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb' + autoload :NotebookWorkspace, '2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb' + autoload :DatabaseAccountKind, '2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb' + autoload :DatabaseAccountOfferType, '2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb' + autoload :DefaultConsistencyLevel, '2020-03-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb' + autoload :ConnectorOffer, '2020-03-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb' + autoload :PublicNetworkAccess, '2020-03-01/generated/azure_mgmt_cosmosdb/models/public_network_access.rb' + autoload :IndexingMode, '2020-03-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb' + autoload :DataType, '2020-03-01/generated/azure_mgmt_cosmosdb/models/data_type.rb' + autoload :IndexKind, '2020-03-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb' + autoload :CompositePathSortOrder, '2020-03-01/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb' + autoload :SpatialType, '2020-03-01/generated/azure_mgmt_cosmosdb/models/spatial_type.rb' + autoload :PartitionKind, '2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb' + autoload :ConflictResolutionMode, '2020-03-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb' + autoload :TriggerType, '2020-03-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb' + autoload :TriggerOperation, '2020-03-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb' + autoload :KeyKind, '2020-03-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb' + autoload :UnitType, '2020-03-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb' + autoload :PrimaryAggregationType, '2020-03-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb' + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb new file mode 100644 index 000000000..46e0b54bb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb @@ -0,0 +1,1700 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CassandraResources + include MsRestAzure + + # + # Creates and initializes a new instance of the CassandraResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceListResult] operation results. + # + def list_cassandra_keyspaces(resource_group_name, account_name, custom_headers:nil) + response = list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_cassandra_keyspaces_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraKeyspaceListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceGetResults] operation results. + # + def get_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraKeyspaceGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceGetResults] operation results. + # + def create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + response = create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraKeyspaceGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + # Send request + promise = begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Cassandra Keyspace under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Cassandra Keyspace under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Cassandra Keyspace under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + response = update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableListResult] operation results. + # + def list_cassandra_tables(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_cassandra_tables_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Lists the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraTableListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableGetResults] operation results. + # + def get_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraTableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableGetResults] operation results. + # + def create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + response = create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraTableGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + # Send request + promise = begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos + # DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos + # DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos + # DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + response = update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceGetResults] operation results. + # + def begin_create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + response = begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_cassandra_keyspace_parameters is nil' if create_update_cassandra_keyspace_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraKeyspaceCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_cassandra_keyspace_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraKeyspaceGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableGetResults] operation results. + # + def begin_create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + response = begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_cassandra_table_parameters is nil' if create_update_cassandra_table_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraTableCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_cassandra_table_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraTableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection.rb new file mode 100644 index 000000000..29649bfb5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection.rb @@ -0,0 +1,389 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Collection + include MsRestAzure + + # + # Creates and initializes a new instance of the Collection class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account and collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent storage data) for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent storage data) for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent storage data) for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::UsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves metric definitions for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricDefinitionsListResult] operation results. + # + def list_metric_definitions(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil) + response = list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves metric definitions for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metric_definitions_with_http_info(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil) + list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:custom_headers).value! + end + + # + # Retrieves metric definitions for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MetricDefinitionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_partition.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_partition.rb new file mode 100644 index 000000000..08587dc57 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_partition.rb @@ -0,0 +1,279 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CollectionPartition + include MsRestAzure + + # + # Creates and initializes a new instance of the CollectionPartition class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given + # collection, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given + # collection, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given + # collection, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent storage data) for the given collection, + # split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionUsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent storage data) for the given collection, + # split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent storage data) for the given collection, + # split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::PartitionUsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb new file mode 100644 index 000000000..53690eb78 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb @@ -0,0 +1,161 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CollectionPartitionRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the CollectionPartitionRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given collection + # and region, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given collection + # and region, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given collection + # and region, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_region.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_region.rb new file mode 100644 index 000000000..f5dc48253 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/collection_region.rb @@ -0,0 +1,161 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CollectionRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the CollectionRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account, collection and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account, collection and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account, collection and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb new file mode 100644 index 000000000..cfdf9c133 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb @@ -0,0 +1,203 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # A service client - single point of access to the REST API. + # + class CosmosDBManagementClient < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] The API version to use for this operation. + attr_reader :api_version + + # @return [String] The ID of the target subscription. + attr_accessor :subscription_id + + # @return [String] The preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] The retry timeout in seconds for Long Running + # Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] Whether a unique x-ms-client-request-id should be + # generated. When set to true a unique x-ms-client-request-id value is + # generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [DatabaseAccounts] database_accounts + attr_reader :database_accounts + + # @return [Operations] operations + attr_reader :operations + + # @return [Database] database + attr_reader :database + + # @return [Collection] collection + attr_reader :collection + + # @return [CollectionRegion] collection_region + attr_reader :collection_region + + # @return [DatabaseAccountRegion] database_account_region + attr_reader :database_account_region + + # @return [PercentileSourceTarget] percentile_source_target + attr_reader :percentile_source_target + + # @return [PercentileTarget] percentile_target + attr_reader :percentile_target + + # @return [Percentile] percentile + attr_reader :percentile + + # @return [CollectionPartitionRegion] collection_partition_region + attr_reader :collection_partition_region + + # @return [CollectionPartition] collection_partition + attr_reader :collection_partition + + # @return [PartitionKeyRangeId] partition_key_range_id + attr_reader :partition_key_range_id + + # @return [PartitionKeyRangeIdRegion] partition_key_range_id_region + attr_reader :partition_key_range_id_region + + # @return [SqlResources] sql_resources + attr_reader :sql_resources + + # @return [MongoDBResources] mongo_dbresources + attr_reader :mongo_dbresources + + # @return [TableResources] table_resources + attr_reader :table_resources + + # @return [CassandraResources] cassandra_resources + attr_reader :cassandra_resources + + # @return [GremlinResources] gremlin_resources + attr_reader :gremlin_resources + + # @return [NotebookWorkspaces] notebook_workspaces + attr_reader :notebook_workspaces + + # + # Creates initializes a new instance of the CosmosDBManagementClient class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @database_accounts = DatabaseAccounts.new(self) + @operations = Operations.new(self) + @database = Database.new(self) + @collection = Collection.new(self) + @collection_region = CollectionRegion.new(self) + @database_account_region = DatabaseAccountRegion.new(self) + @percentile_source_target = PercentileSourceTarget.new(self) + @percentile_target = PercentileTarget.new(self) + @percentile = Percentile.new(self) + @collection_partition_region = CollectionPartitionRegion.new(self) + @collection_partition = CollectionPartition.new(self) + @partition_key_range_id = PartitionKeyRangeId.new(self) + @partition_key_range_id_region = PartitionKeyRangeIdRegion.new(self) + @sql_resources = SqlResources.new(self) + @mongo_dbresources = MongoDBResources.new(self) + @table_resources = TableResources.new(self) + @cassandra_resources = CassandraResources.new(self) + @gremlin_resources = GremlinResources.new(self) + @notebook_workspaces = NotebookWorkspaces.new(self) + @api_version = '2020-03-01' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) + @request_headers['Content-Type'] = options[:headers]['Content-Type'] + end + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_cosmosdb' + sdk_information = "#{sdk_information}/0.21.2" + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database.rb new file mode 100644 index 000000000..be98f744b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database.rb @@ -0,0 +1,377 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Database + include MsRestAzure + + # + # Creates and initializes a new instance of the Database class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account and database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent data) for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, database_rid, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, database_rid, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent data) for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, database_rid, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, database_rid, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent data) for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, database_rid, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::UsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves metric definitions for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricDefinitionsListResult] operation results. + # + def list_metric_definitions(resource_group_name, account_name, database_rid, custom_headers:nil) + response = list_metric_definitions_async(resource_group_name, account_name, database_rid, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves metric definitions for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metric_definitions_with_http_info(resource_group_name, account_name, database_rid, custom_headers:nil) + list_metric_definitions_async(resource_group_name, account_name, database_rid, custom_headers:custom_headers).value! + end + + # + # Retrieves metric definitions for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metric_definitions_async(resource_group_name, account_name, database_rid, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MetricDefinitionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database_account_region.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database_account_region.rb new file mode 100644 index 000000000..fce6732f4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database_account_region.rb @@ -0,0 +1,153 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class DatabaseAccountRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the DatabaseAccountRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database_accounts.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database_accounts.rb new file mode 100644 index 000000000..b0b0cce17 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/database_accounts.rb @@ -0,0 +1,2281 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class DatabaseAccounts + include MsRestAzure + + # + # Creates and initializes a new instance of the DatabaseAccounts class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def get(resource_group_name, account_name, custom_headers:nil) + response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, account_name, custom_headers:nil) + get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Retrieves the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def update(resource_group_name, account_name, update_parameters, custom_headers:nil) + response = update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, account_name, update_parameters, custom_headers:nil) + # Send request + promise = begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def create_or_update(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + response = create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, account_name, custom_headers:nil) + response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def failover_priority_change(resource_group_name, account_name, failover_parameters, custom_headers:nil) + response = failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:nil) + # Send request + promise = begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists all the Azure Cosmos DB database accounts available under the + # subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountsListResult] operation results. + # + def list(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all the Azure Cosmos DB database accounts available under the + # subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Lists all the Azure Cosmos DB database accounts available under the + # subscription. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all the Azure Cosmos DB database accounts available under the given + # resource group. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountsListResult] operation results. + # + def list_by_resource_group(resource_group_name, custom_headers:nil) + response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all the Azure Cosmos DB database accounts available under the given + # resource group. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil) + list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! + end + + # + # Lists all the Azure Cosmos DB database accounts available under the given + # resource group. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, custom_headers:nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists the access keys for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListKeysResult] operation results. + # + def list_keys(resource_group_name, account_name, custom_headers:nil) + response = list_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the access keys for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the access keys for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_keys_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountListKeysResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists the connection strings for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListConnectionStringsResult] operation results. + # + def list_connection_strings(resource_group_name, account_name, custom_headers:nil) + response = list_connection_strings_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the connection strings for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_connection_strings_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_connection_strings_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the connection strings for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_connection_strings_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountListConnectionStringsResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def offline_region(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + response = offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + # Send request + promise = begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def online_region(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + response = online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + # Send request + promise = begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListReadOnlyKeysResult] operation results. + # + def get_read_only_keys(resource_group_name, account_name, custom_headers:nil) + response = get_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_read_only_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) + get_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_read_only_keys_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountListReadOnlyKeysResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListReadOnlyKeysResult] operation results. + # + def list_read_only_keys(resource_group_name, account_name, custom_headers:nil) + response = list_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_read_only_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_read_only_keys_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountListReadOnlyKeysResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def regenerate_key(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + response = regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + # Send request + promise = begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Checks that the Azure Cosmos DB account name already exists. A valid account + # name may contain only lowercase letters, numbers, and the '-' character, and + # must be between 3 and 50 characters. + # + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Boolean] operation results. + # + def check_name_exists(account_name, custom_headers:nil) + response = check_name_exists_async(account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Checks that the Azure Cosmos DB account name already exists. A valid account + # name may contain only lowercase letters, numbers, and the '-' character, and + # must be between 3 and 50 characters. + # + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def check_name_exists_with_http_info(account_name, custom_headers:nil) + check_name_exists_async(account_name, custom_headers:custom_headers).value! + end + + # + # Checks that the Azure Cosmos DB account name already exists. A valid account + # name may contain only lowercase letters, numbers, and the '-' character, and + # must be between 3 and 50 characters. + # + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def check_name_exists_async(account_name, custom_headers:nil) + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:head, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 404 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.body = (status_code == 200) + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent data) for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent data) for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent data) for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::UsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves metric definitions for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricDefinitionsListResult] operation results. + # + def list_metric_definitions(resource_group_name, account_name, custom_headers:nil) + response = list_metric_definitions_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves metric definitions for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metric_definitions_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_metric_definitions_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Retrieves metric definitions for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metric_definitions_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MetricDefinitionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def begin_update(resource_group_name, account_name, update_parameters, custom_headers:nil) + response = begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, account_name, update_parameters, custom_headers:nil) + begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_parameters is nil' if update_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def begin_create_or_update(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_parameters is nil' if create_update_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, account_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_failover_priority_change(resource_group_name, account_name, failover_parameters, custom_headers:nil) + response = begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! + nil + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_failover_priority_change_with_http_info(resource_group_name, account_name, failover_parameters, custom_headers:nil) + begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'failover_parameters is nil' if failover_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::FailoverPolicies.mapper() + request_content = @client.serialize(request_mapper, failover_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_offline_region(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + response = begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! + nil + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_offline_region_with_http_info(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'region_parameter_for_offline is nil' if region_parameter_for_offline.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::RegionForOnlineOffline.mapper() + request_content = @client.serialize(request_mapper, region_parameter_for_offline) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_online_region(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + response = begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! + nil + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_online_region_with_http_info(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'region_parameter_for_online is nil' if region_parameter_for_online.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::RegionForOnlineOffline.mapper() + request_content = @client.serialize(request_mapper, region_parameter_for_online) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_regenerate_key(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + response = begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! + nil + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_regenerate_key_with_http_info(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'key_to_regenerate is nil' if key_to_regenerate.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::DatabaseAccountRegenerateKeyParameters.mapper() + request_content = @client.serialize(request_mapper, key_to_regenerate) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb new file mode 100644 index 000000000..e7799603c --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb @@ -0,0 +1,1695 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class GremlinResources + include MsRestAzure + + # + # Creates and initializes a new instance of the GremlinResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the Gremlin databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseListResult] operation results. + # + def list_gremlin_databases(resource_group_name, account_name, custom_headers:nil) + response = list_gremlin_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Gremlin databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_gremlin_databases_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_gremlin_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the Gremlin databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_gremlin_databases_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::GremlinDatabaseListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Gremlin databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseGetResults] operation results. + # + def get_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Gremlin databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the Gremlin databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::GremlinDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseGetResults] operation results. + # + def create_update_gremlin_database(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + response = create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::GremlinDatabaseGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + # Send request + promise = begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Gremlin database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_gremlin_database_throughput(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Gremlin database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_database_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Gremlin database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_gremlin_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphListResult] operation results. + # + def list_gremlin_graphs(resource_group_name, account_name, database_name, custom_headers:nil) + response = list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_gremlin_graphs_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Lists the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::GremlinGraphListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphGetResults] operation results. + # + def get_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + end + + # + # Gets the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::GremlinGraphGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphGetResults] operation results. + # + def create_update_gremlin_graph(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + response = create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::GremlinGraphGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + # Send request + promise = begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_graph_throughput_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + end + + # + # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + response = update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseGetResults] operation results. + # + def begin_create_update_gremlin_database(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + response = begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_gremlin_database_with_http_info(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_gremlin_database_parameters is nil' if create_update_gremlin_database_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::GremlinDatabaseCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_gremlin_database_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::GremlinDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_gremlin_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_gremlin_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_gremlin_database_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphGetResults] operation results. + # + def begin_create_update_gremlin_graph(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + response = begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_gremlin_graph_parameters is nil' if create_update_gremlin_graph_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::GremlinGraphCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_gremlin_graph_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::GremlinGraphGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_gremlin_graph_throughput_with_http_info(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb new file mode 100644 index 000000000..4dd5d7267 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The resource model definition for a ARM proxy resource. It will have + # everything other than required location and tags + # + class ARMProxyResource + + include MsRestAzure + + # @return [String] The unique resource identifier of the database + # account. + attr_accessor :id + + # @return [String] The name of the database account. + attr_accessor :name + + # @return [String] The type of Azure resource. + attr_accessor :type + + + # + # Mapper for ARMProxyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ARMProxyResource', + type: { + name: 'Composite', + class_name: 'ARMProxyResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb new file mode 100644 index 000000000..f691f070b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb @@ -0,0 +1,102 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The core properties of ARM resources. + # + class ARMResourceProperties + + include MsRestAzure + + # @return [String] The unique resource identifier of the ARM resource. + attr_accessor :id + + # @return [String] The name of the ARM resource. + attr_accessor :name + + # @return [String] The type of Azure resource. + attr_accessor :type + + # @return [String] The location of the resource group to which the + # resource belongs. + attr_accessor :location + + # @return [Hash{String => String}] + attr_accessor :tags + + + # + # Mapper for ARMResourceProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ARMResourceProperties', + type: { + name: 'Composite', + class_name: 'ARMResourceProperties', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb new file mode 100644 index 000000000..1a6771cc1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB resource auto-upgrade policy + # + class AutoUpgradePolicyResource + + include MsRestAzure + + # @return [ThroughputPolicyResource] Represents throughput policy which + # service must adhere to for auto-upgrade + attr_accessor :throughput_policy + + + # + # Mapper for AutoUpgradePolicyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AutoUpgradePolicyResource', + type: { + name: 'Composite', + class_name: 'AutoUpgradePolicyResource', + model_properties: { + throughput_policy: { + client_side_validation: true, + required: false, + serialized_name: 'throughputPolicy', + type: { + name: 'Composite', + class_name: 'ThroughputPolicyResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb new file mode 100644 index 000000000..9faf96802 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb @@ -0,0 +1,75 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The resource model definition for a Azure Resource Manager resource with + # an etag. + # + class AzureEntityResource < Resource + + include MsRestAzure + + # @return [String] Resource Etag. + attr_accessor :etag + + + # + # Mapper for AzureEntityResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AzureEntityResource', + type: { + name: 'Composite', + class_name: 'AzureEntityResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/capability.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/capability.rb new file mode 100644 index 000000000..3dd9c6391 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/capability.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB capability object + # + class Capability + + include MsRestAzure + + # @return [String] Name of the Cosmos DB capability. For example, "name": + # "EnableCassandra". Current values also include "EnableTable" and + # "EnableGremlin". + attr_accessor :name + + + # + # Mapper for Capability class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Capability', + type: { + name: 'Composite', + class_name: 'Capability', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb new file mode 100644 index 000000000..d52f79cd8 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB Cassandra keyspace. + # + class CassandraKeyspaceCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraKeyspaceResource] The standard JSON format of a + # Cassandra keyspace + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for CassandraKeyspaceCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb new file mode 100644 index 000000000..80275539a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class CassandraKeyspaceGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for CassandraKeyspaceGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceGetProperties_options', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb new file mode 100644 index 000000000..a22903228 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class CassandraKeyspaceGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra keyspace + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for CassandraKeyspaceGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceGetProperties_resource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb new file mode 100644 index 000000000..639602bfc --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB Cassandra keyspace. + # + class CassandraKeyspaceGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraKeyspaceGetPropertiesResource] + attr_accessor :resource + + # @return [CassandraKeyspaceGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for CassandraKeyspaceGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceGetResults', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb new file mode 100644 index 000000000..66e468c2f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the Cassandra keyspaces and + # their properties. + # + class CassandraKeyspaceListResult + + include MsRestAzure + + # @return [Array] List of Cassandra + # keyspaces and their properties. + attr_accessor :value + + + # + # Mapper for CassandraKeyspaceListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceListResult', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceGetResultsElementType', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb new file mode 100644 index 000000000..a94c48ffb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB Cassandra keyspace resource object + # + class CassandraKeyspaceResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra keyspace + attr_accessor :id + + + # + # Mapper for CassandraKeyspaceResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceResource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb new file mode 100644 index 000000000..3765b85d3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB Cassandra table partition key + # + class CassandraPartitionKey + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table partition key + attr_accessor :name + + + # + # Mapper for CassandraPartitionKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraPartitionKey', + type: { + name: 'Composite', + class_name: 'CassandraPartitionKey', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb new file mode 100644 index 000000000..69b4bb741 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb @@ -0,0 +1,95 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB Cassandra table schema + # + class CassandraSchema + + include MsRestAzure + + # @return [Array] List of Cassandra table columns. + attr_accessor :columns + + # @return [Array] List of partition key. + attr_accessor :partition_keys + + # @return [Array] List of cluster key. + attr_accessor :cluster_keys + + + # + # Mapper for CassandraSchema class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraSchema', + type: { + name: 'Composite', + class_name: 'CassandraSchema', + model_properties: { + columns: { + client_side_validation: true, + required: false, + serialized_name: 'columns', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ColumnElementType', + type: { + name: 'Composite', + class_name: 'Column' + } + } + } + }, + partition_keys: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKeys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CassandraPartitionKeyElementType', + type: { + name: 'Composite', + class_name: 'CassandraPartitionKey' + } + } + } + }, + cluster_keys: { + client_side_validation: true, + required: false, + serialized_name: 'clusterKeys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ClusterKeyElementType', + type: { + name: 'Composite', + class_name: 'ClusterKey' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb new file mode 100644 index 000000000..42057b890 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB Cassandra table. + # + class CassandraTableCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraTableResource] The standard JSON format of a + # Cassandra table + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for CassandraTableCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'CassandraTableCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraTableResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb new file mode 100644 index 000000000..ac6484b27 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class CassandraTableGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for CassandraTableGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableGetProperties_options', + type: { + name: 'Composite', + class_name: 'CassandraTableGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb new file mode 100644 index 000000000..9d2a59a10 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb @@ -0,0 +1,108 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class CassandraTableGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table + attr_accessor :id + + # @return [Integer] Time to live of the Cosmos DB Cassandra table + attr_accessor :default_ttl + + # @return [CassandraSchema] Schema of the Cosmos DB Cassandra table + attr_accessor :schema + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for CassandraTableGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableGetProperties_resource', + type: { + name: 'Composite', + class_name: 'CassandraTableGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + schema: { + client_side_validation: true, + required: false, + serialized_name: 'schema', + type: { + name: 'Composite', + class_name: 'CassandraSchema' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb new file mode 100644 index 000000000..2905f3501 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB Cassandra table. + # + class CassandraTableGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraTableGetPropertiesResource] + attr_accessor :resource + + # @return [CassandraTableGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for CassandraTableGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableGetResults', + type: { + name: 'Composite', + class_name: 'CassandraTableGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraTableGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CassandraTableGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb new file mode 100644 index 000000000..9d00695b4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the Cassandra tables and their + # properties. + # + class CassandraTableListResult + + include MsRestAzure + + # @return [Array] List of Cassandra tables and + # their properties. + attr_accessor :value + + + # + # Mapper for CassandraTableListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableListResult', + type: { + name: 'Composite', + class_name: 'CassandraTableListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableGetResultsElementType', + type: { + name: 'Composite', + class_name: 'CassandraTableGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb new file mode 100644 index 000000000..7dd8a901a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB Cassandra table resource object + # + class CassandraTableResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table + attr_accessor :id + + # @return [Integer] Time to live of the Cosmos DB Cassandra table + attr_accessor :default_ttl + + # @return [CassandraSchema] Schema of the Cosmos DB Cassandra table + attr_accessor :schema + + + # + # Mapper for CassandraTableResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableResource', + type: { + name: 'Composite', + class_name: 'CassandraTableResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + schema: { + client_side_validation: true, + required: false, + serialized_name: 'schema', + type: { + name: 'Composite', + class_name: 'CassandraSchema' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb new file mode 100644 index 000000000..8fc587f01 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB Cassandra table cluster key + # + class ClusterKey + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table cluster key + attr_accessor :name + + # @return [String] Order of the Cosmos DB Cassandra table cluster key, + # only support "Asc" and "Desc" + attr_accessor :order_by + + + # + # Mapper for ClusterKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ClusterKey', + type: { + name: 'Composite', + class_name: 'ClusterKey', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + order_by: { + client_side_validation: true, + required: false, + serialized_name: 'orderBy', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/column.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/column.rb new file mode 100644 index 000000000..843362039 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/column.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB Cassandra table column + # + class Column + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table column + attr_accessor :name + + # @return [String] Type of the Cosmos DB Cassandra table column + attr_accessor :type + + + # + # Mapper for Column class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Column', + type: { + name: 'Composite', + class_name: 'Column', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb new file mode 100644 index 000000000..908e7c3e4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class CompositePath + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + # @return [CompositePathSortOrder] Sort order for composite paths. + # Possible values include: 'Ascending', 'Descending' + attr_accessor :order + + + # + # Mapper for CompositePath class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CompositePath', + type: { + name: 'Composite', + class_name: 'CompositePath', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + order: { + client_side_validation: true, + required: false, + serialized_name: 'order', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb new file mode 100644 index 000000000..6beb4f808 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for CompositePathSortOrder + # + module CompositePathSortOrder + Ascending = "Ascending" + Descending = "Descending" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb new file mode 100644 index 000000000..9bfeb7fb2 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for ConflictResolutionMode + # + module ConflictResolutionMode + LastWriterWins = "LastWriterWins" + Custom = "Custom" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb new file mode 100644 index 000000000..d83a290bc --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The conflict resolution policy for the container. + # + class ConflictResolutionPolicy + + include MsRestAzure + + # @return [ConflictResolutionMode] Indicates the conflict resolution + # mode. Possible values include: 'LastWriterWins', 'Custom'. Default + # value: 'LastWriterWins' . + attr_accessor :mode + + # @return [String] The conflict resolution path in the case of + # LastWriterWins mode. + attr_accessor :conflict_resolution_path + + # @return [String] The procedure to resolve conflicts in the case of + # custom mode. + attr_accessor :conflict_resolution_procedure + + + # + # Mapper for ConflictResolutionPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ConflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy', + model_properties: { + mode: { + client_side_validation: true, + required: false, + serialized_name: 'mode', + default_value: 'LastWriterWins', + type: { + name: 'String' + } + }, + conflict_resolution_path: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPath', + type: { + name: 'String' + } + }, + conflict_resolution_procedure: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionProcedure', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb new file mode 100644 index 000000000..21ae56a98 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb @@ -0,0 +1,15 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for ConnectorOffer + # + module ConnectorOffer + Small = "Small" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb new file mode 100644 index 000000000..91ee7816e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb @@ -0,0 +1,86 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The consistency policy for the Cosmos DB database account. + # + class ConsistencyPolicy + + include MsRestAzure + + # @return [DefaultConsistencyLevel] The default consistency level and + # configuration settings of the Cosmos DB account. Possible values + # include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', + # 'ConsistentPrefix' + attr_accessor :default_consistency_level + + # @return [Integer] When used with the Bounded Staleness consistency + # level, this value represents the number of stale requests tolerated. + # Accepted range for this value is 1 – 2,147,483,647. Required when + # defaultConsistencyPolicy is set to 'BoundedStaleness'. + attr_accessor :max_staleness_prefix + + # @return [Integer] When used with the Bounded Staleness consistency + # level, this value represents the time amount of staleness (in seconds) + # tolerated. Accepted range for this value is 5 - 86400. Required when + # defaultConsistencyPolicy is set to 'BoundedStaleness'. + attr_accessor :max_interval_in_seconds + + + # + # Mapper for ConsistencyPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ConsistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy', + model_properties: { + default_consistency_level: { + client_side_validation: true, + required: true, + serialized_name: 'defaultConsistencyLevel', + type: { + name: 'Enum', + module: 'DefaultConsistencyLevel' + } + }, + max_staleness_prefix: { + client_side_validation: true, + required: false, + serialized_name: 'maxStalenessPrefix', + constraints: { + InclusiveMaximum: 2147483647, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + max_interval_in_seconds: { + client_side_validation: true, + required: false, + serialized_name: 'maxIntervalInSeconds', + constraints: { + InclusiveMaximum: 86400, + InclusiveMinimum: 5 + }, + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb new file mode 100644 index 000000000..876f83a43 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The configuration of the partition key to be used for partitioning data + # into multiple partitions + # + class ContainerPartitionKey + + include MsRestAzure + + # @return [Array] List of paths using which data within the + # container can be partitioned + attr_accessor :paths + + # @return [PartitionKind] Indicates the kind of algorithm used for + # partitioning. Possible values include: 'Hash', 'Range'. Default value: + # 'Hash' . + attr_accessor :kind + + # @return [Integer] Indicates the version of the partition key definition + attr_accessor :version + + + # + # Mapper for ContainerPartitionKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ContainerPartitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey', + model_properties: { + paths: { + client_side_validation: true, + required: false, + serialized_name: 'paths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'Hash', + type: { + name: 'String' + } + }, + version: { + client_side_validation: true, + required: false, + serialized_name: 'version', + constraints: { + InclusiveMaximum: 2, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb new file mode 100644 index 000000000..1a6a69204 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # CreateUpdateOptions are a list of key-value pairs that describe the + # resource. Supported keys are "If-Match", "If-None-Match", "Session-Token" + # and "Throughput" + # + class CreateUpdateOptions + + include MsRestAzure + + # @return [Hash{String => String}] Unmatched properties from the message + # are deserialized this collection + attr_accessor :additional_properties + + # @return [String] Request Units per second. For example, "throughput": + # "10000". + attr_accessor :throughput + + + # + # Mapper for CreateUpdateOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CreateUpdateOptions', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/data_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/data_type.rb new file mode 100644 index 000000000..feaa880c9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/data_type.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for DataType + # + module DataType + String = "String" + Number = "Number" + Point = "Point" + Polygon = "Polygon" + LineString = "LineString" + MultiPolygon = "MultiPolygon" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb new file mode 100644 index 000000000..7cf3f7703 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Connection string for the Cosmos DB account + # + class DatabaseAccountConnectionString + + include MsRestAzure + + # @return [String] Value of the connection string + attr_accessor :connection_string + + # @return [String] Description of the connection string + attr_accessor :description + + + # + # Mapper for DatabaseAccountConnectionString class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountConnectionString', + type: { + name: 'Composite', + class_name: 'DatabaseAccountConnectionString', + model_properties: { + connection_string: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'connectionString', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb new file mode 100644 index 000000000..1f0af699c --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb @@ -0,0 +1,302 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB database accounts. + # + class DatabaseAccountCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [DatabaseAccountKind] Indicates the type of database account. + # This can only be set at database account creation. Possible values + # include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. Default value: + # 'GlobalDocumentDB' . + attr_accessor :kind + + # @return [ConsistencyPolicy] The consistency policy for the Cosmos DB + # account. + attr_accessor :consistency_policy + + # @return [Array] An array that contains the georeplication + # locations enabled for the Cosmos DB account. + attr_accessor :locations + + # @return [String] The offer type for the database. Default value: + # 'Standard' . + attr_accessor :database_account_offer_type + + # @return [String] Cosmos DB Firewall Support: This value specifies the + # set of IP addresses or IP address ranges in CIDR form to be included as + # the allowed list of client IPs for a given database account. IP + # addresses/ranges must be comma separated and must not contain any + # spaces. + attr_accessor :ip_range_filter + + # @return [Boolean] Flag to indicate whether to enable/disable Virtual + # Network ACL rules. + attr_accessor :is_virtual_network_filter_enabled + + # @return [Boolean] Enables automatic failover of the write region in the + # rare event that the region is unavailable due to an outage. Automatic + # failover will result in a new write region for the account and is + # chosen based on the failover priorities configured for the account. + attr_accessor :enable_automatic_failover + + # @return [Array] List of Cosmos DB capabilities for the + # account + attr_accessor :capabilities + + # @return [Array] List of Virtual Network ACL rules + # configured for the Cosmos DB account. + attr_accessor :virtual_network_rules + + # @return [Boolean] Enables the account to write in multiple locations + attr_accessor :enable_multiple_write_locations + + # @return [Boolean] Enables the cassandra connector on the Cosmos DB C* + # account + attr_accessor :enable_cassandra_connector + + # @return [ConnectorOffer] The cassandra connector offer type for the + # Cosmos DB database C* account. Possible values include: 'Small' + attr_accessor :connector_offer + + # @return [Boolean] Disable write operations on metadata resources + # (databases, containers, throughput) via account keys + attr_accessor :disable_key_based_metadata_write_access + + # @return [String] The URI of the key vault + attr_accessor :key_vault_key_uri + + # @return [PublicNetworkAccess] Whether requests from Public Network are + # allowed. Possible values include: 'Enabled', 'Disabled' + attr_accessor :public_network_access + + + # + # Mapper for DatabaseAccountCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'DatabaseAccountCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'GlobalDocumentDB', + type: { + name: 'String' + } + }, + consistency_policy: { + client_side_validation: true, + required: false, + serialized_name: 'properties.consistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy' + } + }, + locations: { + client_side_validation: true, + required: true, + serialized_name: 'properties.locations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + database_account_offer_type: { + client_side_validation: true, + required: true, + is_constant: true, + serialized_name: 'properties.databaseAccountOfferType', + default_value: 'Standard', + type: { + name: 'String' + } + }, + ip_range_filter: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ipRangeFilter', + type: { + name: 'String' + } + }, + is_virtual_network_filter_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isVirtualNetworkFilterEnabled', + type: { + name: 'Boolean' + } + }, + enable_automatic_failover: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAutomaticFailover', + type: { + name: 'Boolean' + } + }, + capabilities: { + client_side_validation: true, + required: false, + serialized_name: 'properties.capabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CapabilityElementType', + type: { + name: 'Composite', + class_name: 'Capability' + } + } + } + }, + virtual_network_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRuleElementType', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule' + } + } + } + }, + enable_multiple_write_locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableMultipleWriteLocations', + type: { + name: 'Boolean' + } + }, + enable_cassandra_connector: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableCassandraConnector', + type: { + name: 'Boolean' + } + }, + connector_offer: { + client_side_validation: true, + required: false, + serialized_name: 'properties.connectorOffer', + type: { + name: 'String' + } + }, + disable_key_based_metadata_write_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disableKeyBasedMetadataWriteAccess', + type: { + name: 'Boolean' + } + }, + key_vault_key_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.keyVaultKeyUri', + type: { + name: 'String' + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb new file mode 100644 index 000000000..d211fa13f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb @@ -0,0 +1,416 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB database account. + # + class DatabaseAccountGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [DatabaseAccountKind] Indicates the type of database account. + # This can only be set at database account creation. Possible values + # include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. Default value: + # 'GlobalDocumentDB' . + attr_accessor :kind + + # @return [String] + attr_accessor :provisioning_state + + # @return [String] The connection endpoint for the Cosmos DB database + # account. + attr_accessor :document_endpoint + + # @return [DatabaseAccountOfferType] The offer type for the Cosmos DB + # database account. Default value: Standard. Possible values include: + # 'Standard' + attr_accessor :database_account_offer_type + + # @return [String] Cosmos DB Firewall Support: This value specifies the + # set of IP addresses or IP address ranges in CIDR form to be included as + # the allowed list of client IPs for a given database account. IP + # addresses/ranges must be comma separated and must not contain any + # spaces. + attr_accessor :ip_range_filter + + # @return [Boolean] Flag to indicate whether to enable/disable Virtual + # Network ACL rules. + attr_accessor :is_virtual_network_filter_enabled + + # @return [Boolean] Enables automatic failover of the write region in the + # rare event that the region is unavailable due to an outage. Automatic + # failover will result in a new write region for the account and is + # chosen based on the failover priorities configured for the account. + attr_accessor :enable_automatic_failover + + # @return [ConsistencyPolicy] The consistency policy for the Cosmos DB + # database account. + attr_accessor :consistency_policy + + # @return [Array] List of Cosmos DB capabilities for the + # account + attr_accessor :capabilities + + # @return [Array] An array that contains the write location for + # the Cosmos DB account. + attr_accessor :write_locations + + # @return [Array] An array that contains of the read locations + # enabled for the Cosmos DB account. + attr_accessor :read_locations + + # @return [Array] An array that contains all of the locations + # enabled for the Cosmos DB account. + attr_accessor :locations + + # @return [Array] An array that contains the regions + # ordered by their failover priorities. + attr_accessor :failover_policies + + # @return [Array] List of Virtual Network ACL rules + # configured for the Cosmos DB account. + attr_accessor :virtual_network_rules + + # @return [Array] List of Private Endpoint + # Connections configured for the Cosmos DB account. + attr_accessor :private_endpoint_connections + + # @return [Boolean] Enables the account to write in multiple locations + attr_accessor :enable_multiple_write_locations + + # @return [Boolean] Enables the cassandra connector on the Cosmos DB C* + # account + attr_accessor :enable_cassandra_connector + + # @return [ConnectorOffer] The cassandra connector offer type for the + # Cosmos DB database C* account. Possible values include: 'Small' + attr_accessor :connector_offer + + # @return [Boolean] Disable write operations on metadata resources + # (databases, containers, throughput) via account keys + attr_accessor :disable_key_based_metadata_write_access + + # @return [String] The URI of the key vault + attr_accessor :key_vault_key_uri + + # @return [PublicNetworkAccess] Whether requests from Public Network are + # allowed. Possible values include: 'Enabled', 'Disabled' + attr_accessor :public_network_access + + + # + # Mapper for DatabaseAccountGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountGetResults', + type: { + name: 'Composite', + class_name: 'DatabaseAccountGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'GlobalDocumentDB', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + document_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.documentEndpoint', + type: { + name: 'String' + } + }, + database_account_offer_type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.databaseAccountOfferType', + type: { + name: 'Enum', + module: 'DatabaseAccountOfferType' + } + }, + ip_range_filter: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ipRangeFilter', + type: { + name: 'String' + } + }, + is_virtual_network_filter_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isVirtualNetworkFilterEnabled', + type: { + name: 'Boolean' + } + }, + enable_automatic_failover: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAutomaticFailover', + type: { + name: 'Boolean' + } + }, + consistency_policy: { + client_side_validation: true, + required: false, + serialized_name: 'properties.consistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy' + } + }, + capabilities: { + client_side_validation: true, + required: false, + serialized_name: 'properties.capabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CapabilityElementType', + type: { + name: 'Composite', + class_name: 'Capability' + } + } + } + }, + write_locations: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.writeLocations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + read_locations: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.readLocations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + locations: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.locations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + failover_policies: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.failoverPolicies', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicyElementType', + type: { + name: 'Composite', + class_name: 'FailoverPolicy' + } + } + } + }, + virtual_network_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRuleElementType', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule' + } + } + } + }, + private_endpoint_connections: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.privateEndpointConnections', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnectionElementType', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection' + } + } + } + }, + enable_multiple_write_locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableMultipleWriteLocations', + type: { + name: 'Boolean' + } + }, + enable_cassandra_connector: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableCassandraConnector', + type: { + name: 'Boolean' + } + }, + connector_offer: { + client_side_validation: true, + required: false, + serialized_name: 'properties.connectorOffer', + type: { + name: 'String' + } + }, + disable_key_based_metadata_write_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disableKeyBasedMetadataWriteAccess', + type: { + name: 'Boolean' + } + }, + key_vault_key_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.keyVaultKeyUri', + type: { + name: 'String' + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb new file mode 100644 index 000000000..4544f03ca --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for DatabaseAccountKind + # + module DatabaseAccountKind + GlobalDocumentDB = "GlobalDocumentDB" + MongoDB = "MongoDB" + Parse = "Parse" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb new file mode 100644 index 000000000..780649e91 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The connection strings for the given database account. + # + class DatabaseAccountListConnectionStringsResult + + include MsRestAzure + + # @return [Array] An array that contains + # the connection strings for the Cosmos DB account. + attr_accessor :connection_strings + + + # + # Mapper for DatabaseAccountListConnectionStringsResult class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountListConnectionStringsResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountListConnectionStringsResult', + model_properties: { + connection_strings: { + client_side_validation: true, + required: false, + serialized_name: 'connectionStrings', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountConnectionStringElementType', + type: { + name: 'Composite', + class_name: 'DatabaseAccountConnectionString' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb new file mode 100644 index 000000000..7b8e32b67 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The access keys for the given database account. + # + class DatabaseAccountListKeysResult < DatabaseAccountListReadOnlyKeysResult + + include MsRestAzure + + # @return [String] Base 64 encoded value of the primary read-write key. + attr_accessor :primary_master_key + + # @return [String] Base 64 encoded value of the secondary read-write key. + attr_accessor :secondary_master_key + + + # + # Mapper for DatabaseAccountListKeysResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountListKeysResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountListKeysResult', + model_properties: { + primary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryReadonlyMasterKey', + type: { + name: 'String' + } + }, + secondary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'secondaryReadonlyMasterKey', + type: { + name: 'String' + } + }, + primary_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryMasterKey', + type: { + name: 'String' + } + }, + secondary_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'secondaryMasterKey', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb new file mode 100644 index 000000000..0a5f487a3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The read-only access keys for the given database account. + # + class DatabaseAccountListReadOnlyKeysResult + + include MsRestAzure + + # @return [String] Base 64 encoded value of the primary read-only key. + attr_accessor :primary_readonly_master_key + + # @return [String] Base 64 encoded value of the secondary read-only key. + attr_accessor :secondary_readonly_master_key + + + # + # Mapper for DatabaseAccountListReadOnlyKeysResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountListReadOnlyKeysResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountListReadOnlyKeysResult', + model_properties: { + primary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryReadonlyMasterKey', + type: { + name: 'String' + } + }, + secondary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'secondaryReadonlyMasterKey', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb new file mode 100644 index 000000000..7b92f0607 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb @@ -0,0 +1,15 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for DatabaseAccountOfferType + # + module DatabaseAccountOfferType + Standard = "Standard" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb new file mode 100644 index 000000000..5facd8c13 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to regenerate the keys within the database account. + # + class DatabaseAccountRegenerateKeyParameters + + include MsRestAzure + + # @return [KeyKind] The access key to regenerate. Possible values + # include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + attr_accessor :key_kind + + + # + # Mapper for DatabaseAccountRegenerateKeyParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountRegenerateKeyParameters', + type: { + name: 'Composite', + class_name: 'DatabaseAccountRegenerateKeyParameters', + model_properties: { + key_kind: { + client_side_validation: true, + required: true, + serialized_name: 'keyKind', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb new file mode 100644 index 000000000..23451113e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb @@ -0,0 +1,253 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters for patching Azure Cosmos DB database account properties. + # + class DatabaseAccountUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] + attr_accessor :tags + + # @return [String] The location of the resource group to which the + # resource belongs. + attr_accessor :location + + # @return [ConsistencyPolicy] The consistency policy for the Cosmos DB + # account. + attr_accessor :consistency_policy + + # @return [Array] An array that contains the georeplication + # locations enabled for the Cosmos DB account. + attr_accessor :locations + + # @return [String] Cosmos DB Firewall Support: This value specifies the + # set of IP addresses or IP address ranges in CIDR form to be included as + # the allowed list of client IPs for a given database account. IP + # addresses/ranges must be comma separated and must not contain any + # spaces. + attr_accessor :ip_range_filter + + # @return [Boolean] Flag to indicate whether to enable/disable Virtual + # Network ACL rules. + attr_accessor :is_virtual_network_filter_enabled + + # @return [Boolean] Enables automatic failover of the write region in the + # rare event that the region is unavailable due to an outage. Automatic + # failover will result in a new write region for the account and is + # chosen based on the failover priorities configured for the account. + attr_accessor :enable_automatic_failover + + # @return [Array] List of Cosmos DB capabilities for the + # account + attr_accessor :capabilities + + # @return [Array] List of Virtual Network ACL rules + # configured for the Cosmos DB account. + attr_accessor :virtual_network_rules + + # @return [Boolean] Enables the account to write in multiple locations + attr_accessor :enable_multiple_write_locations + + # @return [Boolean] Enables the cassandra connector on the Cosmos DB C* + # account + attr_accessor :enable_cassandra_connector + + # @return [ConnectorOffer] The cassandra connector offer type for the + # Cosmos DB database C* account. Possible values include: 'Small' + attr_accessor :connector_offer + + # @return [Boolean] Disable write operations on metadata resources + # (databases, containers, throughput) via account keys + attr_accessor :disable_key_based_metadata_write_access + + # @return [String] The URI of the key vault + attr_accessor :key_vault_key_uri + + # @return [PublicNetworkAccess] Whether requests from Public Network are + # allowed. Possible values include: 'Enabled', 'Disabled' + attr_accessor :public_network_access + + + # + # Mapper for DatabaseAccountUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountUpdateParameters', + type: { + name: 'Composite', + class_name: 'DatabaseAccountUpdateParameters', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + consistency_policy: { + client_side_validation: true, + required: false, + serialized_name: 'properties.consistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy' + } + }, + locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.locations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + ip_range_filter: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ipRangeFilter', + type: { + name: 'String' + } + }, + is_virtual_network_filter_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isVirtualNetworkFilterEnabled', + type: { + name: 'Boolean' + } + }, + enable_automatic_failover: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAutomaticFailover', + type: { + name: 'Boolean' + } + }, + capabilities: { + client_side_validation: true, + required: false, + serialized_name: 'properties.capabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CapabilityElementType', + type: { + name: 'Composite', + class_name: 'Capability' + } + } + } + }, + virtual_network_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRuleElementType', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule' + } + } + } + }, + enable_multiple_write_locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableMultipleWriteLocations', + type: { + name: 'Boolean' + } + }, + enable_cassandra_connector: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableCassandraConnector', + type: { + name: 'Boolean' + } + }, + connector_offer: { + client_side_validation: true, + required: false, + serialized_name: 'properties.connectorOffer', + type: { + name: 'String' + } + }, + disable_key_based_metadata_write_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disableKeyBasedMetadataWriteAccess', + type: { + name: 'Boolean' + } + }, + key_vault_key_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.keyVaultKeyUri', + type: { + name: 'String' + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb new file mode 100644 index 000000000..651bd51f9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the database accounts and + # their properties. + # + class DatabaseAccountsListResult + + include MsRestAzure + + # @return [Array] List of database account and + # their properties. + attr_accessor :value + + + # + # Mapper for DatabaseAccountsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountsListResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountGetResultsElementType', + type: { + name: 'Composite', + class_name: 'DatabaseAccountGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb new file mode 100644 index 000000000..369798c37 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for DefaultConsistencyLevel + # + module DefaultConsistencyLevel + Eventual = "Eventual" + Session = "Session" + BoundedStaleness = "BoundedStaleness" + Strong = "Strong" + ConsistentPrefix = "ConsistentPrefix" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/error_response.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/error_response.rb new file mode 100644 index 000000000..9f1aea523 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/error_response.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Error Response. + # + class ErrorResponse + + include MsRestAzure + + # @return [String] Error code. + attr_accessor :code + + # @return [String] Error message indicating why the operation failed. + attr_accessor :message + + + # + # Mapper for ErrorResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ErrorResponse', + type: { + name: 'Composite', + class_name: 'ErrorResponse', + model_properties: { + code: { + client_side_validation: true, + required: false, + serialized_name: 'code', + type: { + name: 'String' + } + }, + message: { + client_side_validation: true, + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb new file mode 100644 index 000000000..aa23549f6 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class ExcludedPath + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + + # + # Mapper for ExcludedPath class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExcludedPath', + type: { + name: 'Composite', + class_name: 'ExcludedPath', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb new file mode 100644 index 000000000..3abff8599 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb @@ -0,0 +1,74 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The system generated resource properties associated with SQL databases, + # SQL containers, Gremlin databases and Gremlin graphs. + # + class ExtendedResourceProperties + + include MsRestAzure + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for ExtendedResourceProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExtendedResourceProperties', + type: { + name: 'Composite', + class_name: 'ExtendedResourceProperties', + model_properties: { + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb new file mode 100644 index 000000000..8c5c0cedf --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The list of new failover policies for the failover priority change. + # + class FailoverPolicies + + include MsRestAzure + + # @return [Array] List of failover policies. + attr_accessor :failover_policies + + + # + # Mapper for FailoverPolicies class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicies', + type: { + name: 'Composite', + class_name: 'FailoverPolicies', + model_properties: { + failover_policies: { + client_side_validation: true, + required: true, + serialized_name: 'failoverPolicies', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicyElementType', + type: { + name: 'Composite', + class_name: 'FailoverPolicy' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb new file mode 100644 index 000000000..8c0bc5751 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The failover policy for a given region of a database account. + # + class FailoverPolicy + + include MsRestAzure + + # @return [String] The unique identifier of the region in which the + # database account replicates to. Example: + # <accountName>-<locationName>. + attr_accessor :id + + # @return [String] The name of the region in which the database account + # exists. + attr_accessor :location_name + + # @return [Integer] The failover priority of the region. A failover + # priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority + # values must be unique for each of the regions in which the database + # account exists. + attr_accessor :failover_priority + + + # + # Mapper for FailoverPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicy', + type: { + name: 'Composite', + class_name: 'FailoverPolicy', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + location_name: { + client_side_validation: true, + required: false, + serialized_name: 'locationName', + type: { + name: 'String' + } + }, + failover_priority: { + client_side_validation: true, + required: false, + serialized_name: 'failoverPriority', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb new file mode 100644 index 000000000..df06c4479 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB Gremlin database. + # + class GremlinDatabaseCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinDatabaseResource] The standard JSON format of a Gremlin + # database + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for GremlinDatabaseCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb new file mode 100644 index 000000000..3f44252f3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class GremlinDatabaseGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for GremlinDatabaseGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseGetProperties_options', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb new file mode 100644 index 000000000..ac0f55077 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class GremlinDatabaseGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin database + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for GremlinDatabaseGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseGetProperties_resource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb new file mode 100644 index 000000000..97bac2f39 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB Gremlin database. + # + class GremlinDatabaseGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinDatabaseGetPropertiesResource] + attr_accessor :resource + + # @return [GremlinDatabaseGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for GremlinDatabaseGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseGetResults', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb new file mode 100644 index 000000000..2494ef380 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the Gremlin databases and + # their properties. + # + class GremlinDatabaseListResult + + include MsRestAzure + + # @return [Array] List of Gremlin databases + # and their properties. + attr_accessor :value + + + # + # Mapper for GremlinDatabaseListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseListResult', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseGetResultsElementType', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb new file mode 100644 index 000000000..21a9a1699 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB Gremlin database resource object + # + class GremlinDatabaseResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin database + attr_accessor :id + + + # + # Mapper for GremlinDatabaseResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseResource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb new file mode 100644 index 000000000..392122c99 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB Gremlin graph. + # + class GremlinGraphCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinGraphResource] The standard JSON format of a Gremlin + # graph + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for GremlinGraphCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'GremlinGraphCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinGraphResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb new file mode 100644 index 000000000..e330e1127 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class GremlinGraphGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for GremlinGraphGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphGetProperties_options', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb new file mode 100644 index 000000000..c388ee505 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb @@ -0,0 +1,150 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class GremlinGraphGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin graph + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # graph + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the graph. + attr_accessor :conflict_resolution_policy + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for GremlinGraphGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphGetProperties_resource', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb new file mode 100644 index 000000000..b9d5b2667 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB Gremlin graph. + # + class GremlinGraphGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinGraphGetPropertiesResource] + attr_accessor :resource + + # @return [GremlinGraphGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for GremlinGraphGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphGetResults', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb new file mode 100644 index 000000000..361fd5026 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the graphs and their + # properties. + # + class GremlinGraphListResult + + include MsRestAzure + + # @return [Array] List of graphs and their + # properties. + attr_accessor :value + + + # + # Mapper for GremlinGraphListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphListResult', + type: { + name: 'Composite', + class_name: 'GremlinGraphListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphGetResultsElementType', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb new file mode 100644 index 000000000..4b1bda614 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB Gremlin graph resource object + # + class GremlinGraphResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin graph + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # graph + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the graph. + attr_accessor :conflict_resolution_policy + + + # + # Mapper for GremlinGraphResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphResource', + type: { + name: 'Composite', + class_name: 'GremlinGraphResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/included_path.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/included_path.rb new file mode 100644 index 000000000..31186aaa3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/included_path.rb @@ -0,0 +1,67 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The paths that are included in indexing + # + class IncludedPath + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + # @return [Array] List of indexes for this path + attr_accessor :indexes + + + # + # Mapper for IncludedPath class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'IncludedPath', + type: { + name: 'Composite', + class_name: 'IncludedPath', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + indexes: { + client_side_validation: true, + required: false, + serialized_name: 'indexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'IndexesElementType', + type: { + name: 'Composite', + class_name: 'Indexes' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb new file mode 100644 index 000000000..dbb2fc29e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for IndexKind + # + module IndexKind + Hash = "Hash" + Range = "Range" + Spatial = "Spatial" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexes.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexes.rb new file mode 100644 index 000000000..636dfc112 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexes.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The indexes for the path. + # + class Indexes + + include MsRestAzure + + # @return [DataType] The datatype for which the indexing behavior is + # applied to. Possible values include: 'String', 'Number', 'Point', + # 'Polygon', 'LineString', 'MultiPolygon'. Default value: 'String' . + attr_accessor :data_type + + # @return [Integer] The precision of the index. -1 is maximum precision. + attr_accessor :precision + + # @return [IndexKind] Indicates the type of index. Possible values + # include: 'Hash', 'Range', 'Spatial'. Default value: 'Hash' . + attr_accessor :kind + + + # + # Mapper for Indexes class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Indexes', + type: { + name: 'Composite', + class_name: 'Indexes', + model_properties: { + data_type: { + client_side_validation: true, + required: false, + serialized_name: 'dataType', + default_value: 'String', + type: { + name: 'String' + } + }, + precision: { + client_side_validation: true, + required: false, + serialized_name: 'precision', + type: { + name: 'Number' + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'Hash', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb new file mode 100644 index 000000000..2632847e1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for IndexingMode + # + module IndexingMode + Consistent = "Consistent" + Lazy = "Lazy" + None = "None" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb new file mode 100644 index 000000000..29a90e8ed --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb @@ -0,0 +1,147 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB indexing policy + # + class IndexingPolicy + + include MsRestAzure + + # @return [Boolean] Indicates if the indexing policy is automatic + attr_accessor :automatic + + # @return [IndexingMode] Indicates the indexing mode. Possible values + # include: 'Consistent', 'Lazy', 'None'. Default value: 'Consistent' . + attr_accessor :indexing_mode + + # @return [Array] List of paths to include in the indexing + attr_accessor :included_paths + + # @return [Array] List of paths to exclude from indexing + attr_accessor :excluded_paths + + # @return [Array>] List of composite path list + attr_accessor :composite_indexes + + # @return [Array] List of spatial specifics + attr_accessor :spatial_indexes + + + # + # Mapper for IndexingPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'IndexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy', + model_properties: { + automatic: { + client_side_validation: true, + required: false, + serialized_name: 'automatic', + type: { + name: 'Boolean' + } + }, + indexing_mode: { + client_side_validation: true, + required: false, + serialized_name: 'indexingMode', + default_value: 'Consistent', + type: { + name: 'String' + } + }, + included_paths: { + client_side_validation: true, + required: false, + serialized_name: 'includedPaths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'IncludedPathElementType', + type: { + name: 'Composite', + class_name: 'IncludedPath' + } + } + } + }, + excluded_paths: { + client_side_validation: true, + required: false, + serialized_name: 'excludedPaths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ExcludedPathElementType', + type: { + name: 'Composite', + class_name: 'ExcludedPath' + } + } + } + }, + composite_indexes: { + client_side_validation: true, + required: false, + serialized_name: 'compositeIndexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CompositePathElementType', + type: { + name: 'Composite', + class_name: 'CompositePath' + } + } + } + } + } + }, + spatial_indexes: { + client_side_validation: true, + required: false, + serialized_name: 'spatialIndexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SpatialSpecElementType', + type: { + name: 'Composite', + class_name: 'SpatialSpec' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb new file mode 100644 index 000000000..e73df1c08 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for KeyKind + # + module KeyKind + Primary = "primary" + Secondary = "secondary" + PrimaryReadonly = "primaryReadonly" + SecondaryReadonly = "secondaryReadonly" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/location.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/location.rb new file mode 100644 index 000000000..f309eadcd --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/location.rb @@ -0,0 +1,114 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # A region in which the Azure Cosmos DB database account is deployed. + # + class Location + + include MsRestAzure + + # @return [String] The unique identifier of the region within the + # database account. Example: <accountName>-<locationName>. + attr_accessor :id + + # @return [String] The name of the region. + attr_accessor :location_name + + # @return [String] The connection endpoint for the specific region. + # Example: + # https://<accountName>-<locationName>.documents.azure.com:443/ + attr_accessor :document_endpoint + + # @return [String] + attr_accessor :provisioning_state + + # @return [Integer] The failover priority of the region. A failover + # priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority + # values must be unique for each of the regions in which the database + # account exists. + attr_accessor :failover_priority + + # @return [Boolean] Flag to indicate whether or not this region is an + # AvailabilityZone region + attr_accessor :is_zone_redundant + + + # + # Mapper for Location class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Location', + type: { + name: 'Composite', + class_name: 'Location', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + location_name: { + client_side_validation: true, + required: false, + serialized_name: 'locationName', + type: { + name: 'String' + } + }, + document_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'documentEndpoint', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'provisioningState', + type: { + name: 'String' + } + }, + failover_priority: { + client_side_validation: true, + required: false, + serialized_name: 'failoverPriority', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, + is_zone_redundant: { + client_side_validation: true, + required: false, + serialized_name: 'isZoneRedundant', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric.rb new file mode 100644 index 000000000..9eceacdeb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric.rb @@ -0,0 +1,120 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Metric data + # + class Metric + + include MsRestAzure + + # @return [DateTime] The start time for the metric (ISO-8601 format). + attr_accessor :start_time + + # @return [DateTime] The end time for the metric (ISO-8601 format). + attr_accessor :end_time + + # @return [String] The time grain to be used to summarize the metric + # values. + attr_accessor :time_grain + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + # @return [Array] The metric values for the specified time + # window and timestep. + attr_accessor :metric_values + + + # + # Mapper for Metric class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Metric', + type: { + name: 'Composite', + class_name: 'Metric', + model_properties: { + start_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + end_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'endTime', + type: { + name: 'DateTime' + } + }, + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + metric_values: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricValues', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricValueElementType', + type: { + name: 'Composite', + class_name: 'MetricValue' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb new file mode 100644 index 000000000..90582849d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The availability of the metric. + # + class MetricAvailability + + include MsRestAzure + + # @return [String] The time grain to be used to summarize the metric + # values. + attr_accessor :time_grain + + # @return [String] The retention for the metric values. + attr_accessor :retention + + + # + # Mapper for MetricAvailability class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricAvailability', + type: { + name: 'Composite', + class_name: 'MetricAvailability', + model_properties: { + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + retention: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'retention', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb new file mode 100644 index 000000000..e90f2641e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb @@ -0,0 +1,109 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The definition of a metric. + # + class MetricDefinition + + include MsRestAzure + + # @return [Array] The list of metric availabilities + # for the account. + attr_accessor :metric_availabilities + + # @return [PrimaryAggregationType] The primary aggregation type of the + # metric. Possible values include: 'None', 'Average', 'Total', 'Minimum', + # 'Maximum', 'Last' + attr_accessor :primary_aggregation_type + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [String] The resource uri of the database. + attr_accessor :resource_uri + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + + # + # Mapper for MetricDefinition class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricDefinition', + type: { + name: 'Composite', + class_name: 'MetricDefinition', + model_properties: { + metric_availabilities: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricAvailabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricAvailabilityElementType', + type: { + name: 'Composite', + class_name: 'MetricAvailability' + } + } + } + }, + primary_aggregation_type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryAggregationType', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + resource_uri: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'resourceUri', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb new file mode 100644 index 000000000..60462aba3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The response to a list metric definitions request. + # + class MetricDefinitionsListResult + + include MsRestAzure + + # @return [Array] The list of metric definitions for + # the account. + attr_accessor :value + + + # + # Mapper for MetricDefinitionsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricDefinitionsListResult', + type: { + name: 'Composite', + class_name: 'MetricDefinitionsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricDefinitionElementType', + type: { + name: 'Composite', + class_name: 'MetricDefinition' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb new file mode 100644 index 000000000..cff39af06 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The response to a list metrics request. + # + class MetricListResult + + include MsRestAzure + + # @return [Array] The list of metrics for the account. + attr_accessor :value + + + # + # Mapper for MetricListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricListResult', + type: { + name: 'Composite', + class_name: 'MetricListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricElementType', + type: { + name: 'Composite', + class_name: 'Metric' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb new file mode 100644 index 000000000..a3531c6f5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # A metric name. + # + class MetricName + + include MsRestAzure + + # @return [String] The name of the metric. + attr_accessor :value + + # @return [String] The friendly name of the metric. + attr_accessor :localized_value + + + # + # Mapper for MetricName class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricName', + type: { + name: 'Composite', + class_name: 'MetricName', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'String' + } + }, + localized_value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'localizedValue', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb new file mode 100644 index 000000000..12aed3c55 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb @@ -0,0 +1,107 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Represents metrics values. + # + class MetricValue + + include MsRestAzure + + # @return [Float] The number of values for the metric. + attr_accessor :_count + + # @return [Float] The average value of the metric. + attr_accessor :average + + # @return [Float] The max value of the metric. + attr_accessor :maximum + + # @return [Float] The min value of the metric. + attr_accessor :minimum + + # @return [DateTime] The metric timestamp (ISO-8601 format). + attr_accessor :timestamp + + # @return [Float] The total value of the metric. + attr_accessor :total + + + # + # Mapper for MetricValue class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricValue', + type: { + name: 'Composite', + class_name: 'MetricValue', + model_properties: { + _count: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_count', + type: { + name: 'Double' + } + }, + average: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'average', + type: { + name: 'Double' + } + }, + maximum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'maximum', + type: { + name: 'Double' + } + }, + minimum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimum', + type: { + name: 'Double' + } + }, + timestamp: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timestamp', + type: { + name: 'DateTime' + } + }, + total: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'total', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb new file mode 100644 index 000000000..4cbcfb483 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB MongoDB collection. + # + class MongoDBCollectionCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBCollectionResource] The standard JSON format of a + # MongoDB collection + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for MongoDBCollectionCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb new file mode 100644 index 000000000..16a9fe39a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class MongoDBCollectionGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for MongoDBCollectionGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionGetProperties_options', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb new file mode 100644 index 000000000..06ea36984 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb @@ -0,0 +1,125 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class MongoDBCollectionGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB collection + attr_accessor :id + + # @return [Hash{String => String}] A key-value pair of shard keys to be + # applied for the request. + attr_accessor :shard_key + + # @return [Array] List of index keys + attr_accessor :indexes + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for MongoDBCollectionGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionGetProperties_resource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + shard_key: { + client_side_validation: true, + required: false, + serialized_name: 'shardKey', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + indexes: { + client_side_validation: true, + required: false, + serialized_name: 'indexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexElementType', + type: { + name: 'Composite', + class_name: 'MongoIndex' + } + } + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb new file mode 100644 index 000000000..f5817e670 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB MongoDB collection. + # + class MongoDBCollectionGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBCollectionGetPropertiesResource] + attr_accessor :resource + + # @return [MongoDBCollectionGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for MongoDBCollectionGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionGetResults', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb new file mode 100644 index 000000000..03aa7f53a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the MongoDB collections and + # their properties. + # + class MongoDBCollectionListResult + + include MsRestAzure + + # @return [Array] List of MongoDB + # collections and their properties. + attr_accessor :value + + + # + # Mapper for MongoDBCollectionListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionListResult', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionGetResultsElementType', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb new file mode 100644 index 000000000..b08e639e4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb @@ -0,0 +1,86 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB MongoDB collection resource object + # + class MongoDBCollectionResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB collection + attr_accessor :id + + # @return [Hash{String => String}] A key-value pair of shard keys to be + # applied for the request. + attr_accessor :shard_key + + # @return [Array] List of index keys + attr_accessor :indexes + + + # + # Mapper for MongoDBCollectionResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionResource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + shard_key: { + client_side_validation: true, + required: false, + serialized_name: 'shardKey', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + indexes: { + client_side_validation: true, + required: false, + serialized_name: 'indexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexElementType', + type: { + name: 'Composite', + class_name: 'MongoIndex' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb new file mode 100644 index 000000000..13e68d1c5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB MongoDB database. + # + class MongoDBDatabaseCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBDatabaseResource] The standard JSON format of a MongoDB + # database + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for MongoDBDatabaseCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb new file mode 100644 index 000000000..5ab055f32 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class MongoDBDatabaseGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for MongoDBDatabaseGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseGetProperties_options', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb new file mode 100644 index 000000000..7abaed304 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class MongoDBDatabaseGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB database + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for MongoDBDatabaseGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseGetProperties_resource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb new file mode 100644 index 000000000..53fbdbb4d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB MongoDB database. + # + class MongoDBDatabaseGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBDatabaseGetPropertiesResource] + attr_accessor :resource + + # @return [MongoDBDatabaseGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for MongoDBDatabaseGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseGetResults', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb new file mode 100644 index 000000000..81b94ba2e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the MongoDB databases and + # their properties. + # + class MongoDBDatabaseListResult + + include MsRestAzure + + # @return [Array] List of MongoDB databases + # and their properties. + attr_accessor :value + + + # + # Mapper for MongoDBDatabaseListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseListResult', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseGetResultsElementType', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb new file mode 100644 index 000000000..cb9e85542 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB MongoDB database resource object + # + class MongoDBDatabaseResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB database + attr_accessor :id + + + # + # Mapper for MongoDBDatabaseResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseResource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb new file mode 100644 index 000000000..5078c78ea --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB MongoDB collection index key + # + class MongoIndex + + include MsRestAzure + + # @return [MongoIndexKeys] Cosmos DB MongoDB collection index keys + attr_accessor :key + + # @return [MongoIndexOptions] Cosmos DB MongoDB collection index key + # options + attr_accessor :options + + + # + # Mapper for MongoIndex class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndex', + type: { + name: 'Composite', + class_name: 'MongoIndex', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'Composite', + class_name: 'MongoIndexKeys' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'options', + type: { + name: 'Composite', + class_name: 'MongoIndexOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb new file mode 100644 index 000000000..3824f551f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB MongoDB collection resource object + # + class MongoIndexKeys + + include MsRestAzure + + # @return [Array] List of keys for each MongoDB collection in the + # Azure Cosmos DB service + attr_accessor :keys + + + # + # Mapper for MongoIndexKeys class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexKeys', + type: { + name: 'Composite', + class_name: 'MongoIndexKeys', + model_properties: { + keys: { + client_side_validation: true, + required: false, + serialized_name: 'keys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb new file mode 100644 index 000000000..bb8ad0ca9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB MongoDB collection index options + # + class MongoIndexOptions + + include MsRestAzure + + # @return [Integer] Expire after seconds + attr_accessor :expire_after_seconds + + # @return [Boolean] Is unique or not + attr_accessor :unique + + + # + # Mapper for MongoIndexOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexOptions', + type: { + name: 'Composite', + class_name: 'MongoIndexOptions', + model_properties: { + expire_after_seconds: { + client_side_validation: true, + required: false, + serialized_name: 'expireAfterSeconds', + type: { + name: 'Number' + } + }, + unique: { + client_side_validation: true, + required: false, + serialized_name: 'unique', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb new file mode 100644 index 000000000..d448f78e0 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb @@ -0,0 +1,87 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # A notebook workspace resource + # + class NotebookWorkspace < ARMProxyResource + + include MsRestAzure + + # @return [String] Specifies the endpoint of Notebook server. + attr_accessor :notebook_server_endpoint + + # @return [String] Status of the notebook workspace. Possible values are: + # Creating, Online, Deleting, Failed, Updating. + attr_accessor :status + + + # + # Mapper for NotebookWorkspace class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspace', + type: { + name: 'Composite', + class_name: 'NotebookWorkspace', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + notebook_server_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.notebookServerEndpoint', + type: { + name: 'String' + } + }, + status: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.status', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb new file mode 100644 index 000000000..733be1d7e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The connection info for the given notebook workspace + # + class NotebookWorkspaceConnectionInfoResult + + include MsRestAzure + + # @return [String] Specifies auth token used for connecting to Notebook + # server (uses token-based auth). + attr_accessor :auth_token + + # @return [String] Specifies the endpoint of Notebook server. + attr_accessor :notebook_server_endpoint + + + # + # Mapper for NotebookWorkspaceConnectionInfoResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceConnectionInfoResult', + type: { + name: 'Composite', + class_name: 'NotebookWorkspaceConnectionInfoResult', + model_properties: { + auth_token: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'authToken', + type: { + name: 'String' + } + }, + notebook_server_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'notebookServerEndpoint', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb new file mode 100644 index 000000000..7b7a40612 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb @@ -0,0 +1,62 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create a notebook workspace resource + # + class NotebookWorkspaceCreateUpdateParameters < ARMProxyResource + + include MsRestAzure + + + # + # Mapper for NotebookWorkspaceCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'NotebookWorkspaceCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb new file mode 100644 index 000000000..a381c248e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # A list of notebook workspace resources + # + class NotebookWorkspaceListResult + + include MsRestAzure + + # @return [Array] Array of notebook workspace + # resources + attr_accessor :value + + + # + # Mapper for NotebookWorkspaceListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceListResult', + type: { + name: 'Composite', + class_name: 'NotebookWorkspaceListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceElementType', + type: { + name: 'Composite', + class_name: 'NotebookWorkspace' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation.rb new file mode 100644 index 000000000..1e6aef2b3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # REST API operation + # + class Operation + + include MsRestAzure + + # @return [String] Operation name: {provider}/{resource}/{operation} + attr_accessor :name + + # @return [OperationDisplay] The object that represents the operation. + attr_accessor :display + + + # + # Mapper for Operation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Operation', + type: { + name: 'Composite', + class_name: 'Operation', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + client_side_validation: true, + required: false, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationDisplay' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb new file mode 100644 index 000000000..afa21ce8a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb @@ -0,0 +1,80 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The object that represents the operation. + # + class OperationDisplay + + include MsRestAzure + + # @return [String] Service provider: Microsoft.ResourceProvider + attr_accessor :provider + + # @return [String] Resource on which the operation is performed: Profile, + # endpoint, etc. + attr_accessor :resource + + # @return [String] Operation type: Read, write, delete, etc. + attr_accessor :operation + + # @return [String] Description of operation + attr_accessor :description + + + # + # Mapper for OperationDisplay class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Operation_display', + type: { + name: 'Composite', + class_name: 'OperationDisplay', + model_properties: { + provider: { + client_side_validation: true, + required: false, + serialized_name: 'Provider', + type: { + name: 'String' + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'Resource', + type: { + name: 'String' + } + }, + operation: { + client_side_validation: true, + required: false, + serialized_name: 'Operation', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'Description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb new file mode 100644 index 000000000..94dca9074 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # 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. + # + class OperationListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] List of operations supported by the Resource + # Provider. + attr_accessor :value + + # @return [String] URL to get the next set of operation list results if + # there are any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [OperationListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for OperationListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationListResult', + type: { + name: 'Composite', + class_name: 'OperationListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'OperationElementType', + type: { + name: 'Composite', + class_name: 'Operation' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb new file mode 100644 index 000000000..2bd1bc5f1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB options resource object + # + class OptionsResource + + include MsRestAzure + + # @return [Integer] Value of the Cosmos DB resource throughput. Use the + # ThroughputSetting resource when retrieving offer details. + attr_accessor :throughput + + + # + # Mapper for OptionsResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OptionsResource', + type: { + name: 'Composite', + class_name: 'OptionsResource', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb new file mode 100644 index 000000000..1ebcdddc5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for PartitionKind + # + module PartitionKind + Hash = "Hash" + Range = "Range" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb new file mode 100644 index 000000000..8d89ace57 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb @@ -0,0 +1,124 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The metric values for a single partition. + # + class PartitionMetric < Metric + + include MsRestAzure + + # @return [String] The partition id (GUID identifier) of the metric + # values. + attr_accessor :partition_id + + # @return [String] The partition key range id (integer identifier) of the + # metric values. + attr_accessor :partition_key_range_id + + + # + # Mapper for PartitionMetric class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionMetric', + type: { + name: 'Composite', + class_name: 'PartitionMetric', + model_properties: { + start_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + end_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'endTime', + type: { + name: 'DateTime' + } + }, + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + metric_values: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricValues', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricValueElementType', + type: { + name: 'Composite', + class_name: 'MetricValue' + } + } + } + }, + partition_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionId', + type: { + name: 'String' + } + }, + partition_key_range_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionKeyRangeId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb new file mode 100644 index 000000000..21b9129c4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The response to a list partition metrics request. + # + class PartitionMetricListResult + + include MsRestAzure + + # @return [Array] The list of partition-level metrics + # for the account. + attr_accessor :value + + + # + # Mapper for PartitionMetricListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionMetricListResult', + type: { + name: 'Composite', + class_name: 'PartitionMetricListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PartitionMetricElementType', + type: { + name: 'Composite', + class_name: 'PartitionMetric' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb new file mode 100644 index 000000000..e7a0e5e62 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb @@ -0,0 +1,105 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The partition level usage data for a usage request. + # + class PartitionUsage < Usage + + include MsRestAzure + + # @return [String] The partition id (GUID identifier) of the usages. + attr_accessor :partition_id + + # @return [String] The partition key range id (integer identifier) of the + # usages. + attr_accessor :partition_key_range_id + + + # + # Mapper for PartitionUsage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionUsage', + type: { + name: 'Composite', + class_name: 'PartitionUsage', + model_properties: { + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + quota_period: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'quotaPeriod', + type: { + name: 'String' + } + }, + limit: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'limit', + type: { + name: 'Number' + } + }, + current_value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'currentValue', + type: { + name: 'Number' + } + }, + partition_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionId', + type: { + name: 'String' + } + }, + partition_key_range_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionKeyRangeId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb new file mode 100644 index 000000000..defd271a5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The response to a list partition level usage request. + # + class PartitionUsagesResult + + include MsRestAzure + + # @return [Array] The list of partition-level usages for + # the database. A usage is a point in time metric + attr_accessor :value + + + # + # Mapper for PartitionUsagesResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionUsagesResult', + type: { + name: 'Composite', + class_name: 'PartitionUsagesResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PartitionUsageElementType', + type: { + name: 'Composite', + class_name: 'PartitionUsage' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb new file mode 100644 index 000000000..36689f280 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb @@ -0,0 +1,120 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Percentile Metric data + # + class PercentileMetric + + include MsRestAzure + + # @return [DateTime] The start time for the metric (ISO-8601 format). + attr_accessor :start_time + + # @return [DateTime] The end time for the metric (ISO-8601 format). + attr_accessor :end_time + + # @return [String] The time grain to be used to summarize the metric + # values. + attr_accessor :time_grain + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + # @return [Array] The percentile metric values for + # the specified time window and timestep. + attr_accessor :metric_values + + + # + # Mapper for PercentileMetric class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetric', + type: { + name: 'Composite', + class_name: 'PercentileMetric', + model_properties: { + start_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + end_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'endTime', + type: { + name: 'DateTime' + } + }, + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + metric_values: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricValues', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricValueElementType', + type: { + name: 'Composite', + class_name: 'PercentileMetricValue' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb new file mode 100644 index 000000000..b8831ea4d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The response to a list percentile metrics request. + # + class PercentileMetricListResult + + include MsRestAzure + + # @return [Array] The list of percentile metrics for + # the account. + attr_accessor :value + + + # + # Mapper for PercentileMetricListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricListResult', + type: { + name: 'Composite', + class_name: 'PercentileMetricListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricElementType', + type: { + name: 'Composite', + class_name: 'PercentileMetric' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb new file mode 100644 index 000000000..701fdad18 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb @@ -0,0 +1,173 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Represents percentile metrics values. + # + class PercentileMetricValue < MetricValue + + include MsRestAzure + + # @return [Float] The 10th percentile value for the metric. + attr_accessor :p10 + + # @return [Float] The 25th percentile value for the metric. + attr_accessor :p25 + + # @return [Float] The 50th percentile value for the metric. + attr_accessor :p50 + + # @return [Float] The 75th percentile value for the metric. + attr_accessor :p75 + + # @return [Float] The 90th percentile value for the metric. + attr_accessor :p90 + + # @return [Float] The 95th percentile value for the metric. + attr_accessor :p95 + + # @return [Float] The 99th percentile value for the metric. + attr_accessor :p99 + + + # + # Mapper for PercentileMetricValue class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricValue', + type: { + name: 'Composite', + class_name: 'PercentileMetricValue', + model_properties: { + _count: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_count', + type: { + name: 'Double' + } + }, + average: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'average', + type: { + name: 'Double' + } + }, + maximum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'maximum', + type: { + name: 'Double' + } + }, + minimum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimum', + type: { + name: 'Double' + } + }, + timestamp: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timestamp', + type: { + name: 'DateTime' + } + }, + total: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'total', + type: { + name: 'Double' + } + }, + p10: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P10', + type: { + name: 'Double' + } + }, + p25: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P25', + type: { + name: 'Double' + } + }, + p50: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P50', + type: { + name: 'Double' + } + }, + p75: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P75', + type: { + name: 'Double' + } + }, + p90: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P90', + type: { + name: 'Double' + } + }, + p95: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P95', + type: { + name: 'Double' + } + }, + p99: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P99', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb new file mode 100644 index 000000000..23f8f2c74 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for PrimaryAggregationType + # + module PrimaryAggregationType + None = "None" + Average = "Average" + Total = "Total" + Minimum = "Minimum" + Maximum = "Maximum" + Last = "Last" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb new file mode 100644 index 000000000..86c565baf --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb @@ -0,0 +1,88 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # A private endpoint connection + # + class PrivateEndpointConnection < ProxyResource + + include MsRestAzure + + # @return [PrivateEndpointProperty] Private endpoint which the connection + # belongs to. + attr_accessor :private_endpoint + + # @return [PrivateLinkServiceConnectionStateProperty] Connection State of + # the Private Endpoint Connection. + attr_accessor :private_link_service_connection_state + + + # + # Mapper for PrivateEndpointConnection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnection', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + private_endpoint: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateEndpoint', + type: { + name: 'Composite', + class_name: 'PrivateEndpointProperty' + } + }, + private_link_service_connection_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateLinkServiceConnectionState', + type: { + name: 'Composite', + class_name: 'PrivateLinkServiceConnectionStateProperty' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb new file mode 100644 index 000000000..41b94a87e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Private endpoint which the connection belongs to. + # + class PrivateEndpointProperty + + include MsRestAzure + + # @return [String] Resource id of the private endpoint. + attr_accessor :id + + + # + # Mapper for PrivateEndpointProperty class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointProperty', + type: { + name: 'Composite', + class_name: 'PrivateEndpointProperty', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb new file mode 100644 index 000000000..6688eba11 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Connection State of the Private Endpoint Connection. + # + class PrivateLinkServiceConnectionStateProperty + + include MsRestAzure + + # @return [String] The private link service connection status. + attr_accessor :status + + # @return [String] Any action that is required beyond basic workflow + # (approve/ reject/ disconnect) + attr_accessor :actions_required + + + # + # Mapper for PrivateLinkServiceConnectionStateProperty class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateLinkServiceConnectionStateProperty', + type: { + name: 'Composite', + class_name: 'PrivateLinkServiceConnectionStateProperty', + model_properties: { + status: { + client_side_validation: true, + required: false, + serialized_name: 'status', + type: { + name: 'String' + } + }, + actions_required: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'actionsRequired', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/provisioned_throughput_settings_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/provisioned_throughput_settings_resource.rb new file mode 100644 index 000000000..c49096c4f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/provisioned_throughput_settings_resource.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB provisioned throughput settings object + # + class ProvisionedThroughputSettingsResource + + include MsRestAzure + + # @return [Integer] Represents maximum throughput container can scale up + # to. + attr_accessor :max_throughput + + # @return [AutoUpgradePolicyResource] Cosmos DB resource auto-upgrade + # policy + attr_accessor :auto_upgrade_policy + + # @return [Integer] Represents target maximum throughput container can + # scale up to once offer is no longer in pending state. + attr_accessor :target_max_throughput + + + # + # Mapper for ProvisionedThroughputSettingsResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ProvisionedThroughputSettingsResource', + type: { + name: 'Composite', + class_name: 'ProvisionedThroughputSettingsResource', + model_properties: { + max_throughput: { + client_side_validation: true, + required: true, + serialized_name: 'maxThroughput', + type: { + name: 'Number' + } + }, + auto_upgrade_policy: { + client_side_validation: true, + required: false, + serialized_name: 'autoUpgradePolicy', + type: { + name: 'Composite', + class_name: 'AutoUpgradePolicyResource' + } + }, + target_max_throughput: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'targetMaxThroughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb new file mode 100644 index 000000000..d24c410dd --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb @@ -0,0 +1,63 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The resource model definition for a ARM proxy resource. It will have + # everything other than required location and tags + # + class ProxyResource < Resource + + include MsRestAzure + + + # + # Mapper for ProxyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ProxyResource', + type: { + name: 'Composite', + class_name: 'ProxyResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/public_network_access.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/public_network_access.rb new file mode 100644 index 000000000..3e7e28217 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/public_network_access.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for PublicNetworkAccess + # + module PublicNetworkAccess + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb new file mode 100644 index 000000000..4cb6e5222 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB region to online or offline. + # + class RegionForOnlineOffline + + include MsRestAzure + + # @return [String] Cosmos DB region, with spaces between words and each + # word capitalized. + attr_accessor :region + + + # + # Mapper for RegionForOnlineOffline class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'RegionForOnlineOffline', + type: { + name: 'Composite', + class_name: 'RegionForOnlineOffline', + model_properties: { + region: { + client_side_validation: true, + required: true, + serialized_name: 'region', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/resource.rb new file mode 100644 index 000000000..bba1e53d0 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/resource.rb @@ -0,0 +1,83 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class Resource + + include MsRestAzure + + # @return [String] Fully qualified resource Id for the resource. Ex - + # /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + attr_accessor :id + + # @return [String] The name of the resource + attr_accessor :name + + # @return [String] The type of the resource. Ex- + # Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + attr_accessor :type + + + # @return [String] the name of the resource group of the resource. + def resource_group + unless self.id.nil? + groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/) + groups.captures[0].strip if groups + end + end + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb new file mode 100644 index 000000000..06cbd4949 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb @@ -0,0 +1,67 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class SpatialSpec + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + # @return [Array] List of path's spatial type + attr_accessor :types + + + # + # Mapper for SpatialSpec class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SpatialSpec', + type: { + name: 'Composite', + class_name: 'SpatialSpec', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + types: { + client_side_validation: true, + required: false, + serialized_name: 'types', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SpatialTypeElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/spatial_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/spatial_type.rb new file mode 100644 index 000000000..92f78fdbf --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/spatial_type.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for SpatialType + # + module SpatialType + Point = "Point" + LineString = "LineString" + Polygon = "Polygon" + MultiPolygon = "MultiPolygon" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb new file mode 100644 index 000000000..f128ecd90 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB container. + # + class SqlContainerCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlContainerResource] The standard JSON format of a container + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlContainerCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlContainerCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlContainerResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb new file mode 100644 index 000000000..1973d825e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class SqlContainerGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for SqlContainerGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerGetProperties_options', + type: { + name: 'Composite', + class_name: 'SqlContainerGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb new file mode 100644 index 000000000..aebeaddee --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb @@ -0,0 +1,150 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class SqlContainerGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL container + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # container + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the container. + attr_accessor :conflict_resolution_policy + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlContainerGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlContainerGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb new file mode 100644 index 000000000..86fe61d09 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB container. + # + class SqlContainerGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlContainerGetPropertiesResource] + attr_accessor :resource + + # @return [SqlContainerGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for SqlContainerGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerGetResults', + type: { + name: 'Composite', + class_name: 'SqlContainerGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlContainerGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'SqlContainerGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb new file mode 100644 index 000000000..2268a7eed --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the containers and their + # properties. + # + class SqlContainerListResult + + include MsRestAzure + + # @return [Array] List of containers and their + # properties. + attr_accessor :value + + + # + # Mapper for SqlContainerListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerListResult', + type: { + name: 'Composite', + class_name: 'SqlContainerListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlContainerGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb new file mode 100644 index 000000000..80de886ea --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB SQL container resource object + # + class SqlContainerResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL container + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # container + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the container. + attr_accessor :conflict_resolution_policy + + + # + # Mapper for SqlContainerResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerResource', + type: { + name: 'Composite', + class_name: 'SqlContainerResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb new file mode 100644 index 000000000..48e904297 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB SQL database. + # + class SqlDatabaseCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlDatabaseResource] The standard JSON format of a SQL + # database + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlDatabaseCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlDatabaseCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb new file mode 100644 index 000000000..fe6efc057 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class SqlDatabaseGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for SqlDatabaseGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseGetProperties_options', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb new file mode 100644 index 000000000..c31948692 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb @@ -0,0 +1,109 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class SqlDatabaseGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL database + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + # @return [String] A system generated property that specified the + # addressable path of the collections resource. + attr_accessor :_colls + + # @return [String] A system generated property that specifies the + # addressable path of the users resource. + attr_accessor :_users + + + # + # Mapper for SqlDatabaseGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + }, + _colls: { + client_side_validation: true, + required: false, + serialized_name: '_colls', + type: { + name: 'String' + } + }, + _users: { + client_side_validation: true, + required: false, + serialized_name: '_users', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb new file mode 100644 index 000000000..ba0336c48 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB SQL database. + # + class SqlDatabaseGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlDatabaseGetPropertiesResource] + attr_accessor :resource + + # @return [SqlDatabaseGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for SqlDatabaseGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseGetResults', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb new file mode 100644 index 000000000..0f8482b2d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the SQL databases and their + # properties. + # + class SqlDatabaseListResult + + include MsRestAzure + + # @return [Array] List of SQL databases and their + # properties. + attr_accessor :value + + + # + # Mapper for SqlDatabaseListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseListResult', + type: { + name: 'Composite', + class_name: 'SqlDatabaseListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb new file mode 100644 index 000000000..36c48b138 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB SQL database resource object + # + class SqlDatabaseResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL database + attr_accessor :id + + + # + # Mapper for SqlDatabaseResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseResource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb new file mode 100644 index 000000000..1841bc99b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB storedProcedure. + # + class SqlStoredProcedureCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlStoredProcedureResource] The standard JSON format of a + # storedProcedure + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlStoredProcedureCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb new file mode 100644 index 000000000..c3e19d1ae --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class SqlStoredProcedureGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL storedProcedure + attr_accessor :id + + # @return [String] Body of the Stored Procedure + attr_accessor :body + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlStoredProcedureGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb new file mode 100644 index 000000000..57efd04ba --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB storedProcedure. + # + class SqlStoredProcedureGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlStoredProcedureGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for SqlStoredProcedureGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureGetResults', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb new file mode 100644 index 000000000..f9b17f462 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the storedProcedures and their + # properties. + # + class SqlStoredProcedureListResult + + include MsRestAzure + + # @return [Array] List of storedProcedures + # and their properties. + attr_accessor :value + + + # + # Mapper for SqlStoredProcedureListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureListResult', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb new file mode 100644 index 000000000..9ccc06d87 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB SQL storedProcedure resource object + # + class SqlStoredProcedureResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL storedProcedure + attr_accessor :id + + # @return [String] Body of the Stored Procedure + attr_accessor :body + + + # + # Mapper for SqlStoredProcedureResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureResource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb new file mode 100644 index 000000000..23e41749d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB trigger. + # + class SqlTriggerCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlTriggerResource] The standard JSON format of a trigger + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlTriggerCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlTriggerCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlTriggerResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb new file mode 100644 index 000000000..a3219b93b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb @@ -0,0 +1,121 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class SqlTriggerGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL trigger + attr_accessor :id + + # @return [String] Body of the Trigger + attr_accessor :body + + # @return [TriggerType] Type of the Trigger. Possible values include: + # 'Pre', 'Post' + attr_accessor :trigger_type + + # @return [TriggerOperation] The operation the trigger is associated + # with. Possible values include: 'All', 'Create', 'Update', 'Delete', + # 'Replace' + attr_accessor :trigger_operation + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlTriggerGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + trigger_type: { + client_side_validation: true, + required: false, + serialized_name: 'triggerType', + type: { + name: 'String' + } + }, + trigger_operation: { + client_side_validation: true, + required: false, + serialized_name: 'triggerOperation', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb new file mode 100644 index 000000000..63fe5bbf3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB trigger. + # + class SqlTriggerGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlTriggerGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for SqlTriggerGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerGetResults', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb new file mode 100644 index 000000000..0d0c3777a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the triggers and their + # properties. + # + class SqlTriggerListResult + + include MsRestAzure + + # @return [Array] List of triggers and their + # properties. + attr_accessor :value + + + # + # Mapper for SqlTriggerListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerListResult', + type: { + name: 'Composite', + class_name: 'SqlTriggerListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb new file mode 100644 index 000000000..680c4ccb3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb @@ -0,0 +1,82 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB SQL trigger resource object + # + class SqlTriggerResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL trigger + attr_accessor :id + + # @return [String] Body of the Trigger + attr_accessor :body + + # @return [TriggerType] Type of the Trigger. Possible values include: + # 'Pre', 'Post' + attr_accessor :trigger_type + + # @return [TriggerOperation] The operation the trigger is associated + # with. Possible values include: 'All', 'Create', 'Update', 'Delete', + # 'Replace' + attr_accessor :trigger_operation + + + # + # Mapper for SqlTriggerResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerResource', + type: { + name: 'Composite', + class_name: 'SqlTriggerResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + trigger_type: { + client_side_validation: true, + required: false, + serialized_name: 'triggerType', + type: { + name: 'String' + } + }, + trigger_operation: { + client_side_validation: true, + required: false, + serialized_name: 'triggerOperation', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb new file mode 100644 index 000000000..9052583fb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb @@ -0,0 +1,113 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB userDefinedFunction. + # + class SqlUserDefinedFunctionCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlUserDefinedFunctionResource] The standard JSON format of a + # userDefinedFunction + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlUserDefinedFunctionCreateUpdateParameters class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb new file mode 100644 index 000000000..214ab53ab --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class SqlUserDefinedFunctionGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL userDefinedFunction + attr_accessor :id + + # @return [String] Body of the User Defined Function + attr_accessor :body + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlUserDefinedFunctionGetPropertiesResource class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb new file mode 100644 index 000000000..da170f0b0 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB userDefinedFunction. + # + class SqlUserDefinedFunctionGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlUserDefinedFunctionGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for SqlUserDefinedFunctionGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionGetResults', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb new file mode 100644 index 000000000..028720040 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the userDefinedFunctions and + # their properties. + # + class SqlUserDefinedFunctionListResult + + include MsRestAzure + + # @return [Array] List of + # userDefinedFunctions and their properties. + attr_accessor :value + + + # + # Mapper for SqlUserDefinedFunctionListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionListResult', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb new file mode 100644 index 000000000..e75af790f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB SQL userDefinedFunction resource object + # + class SqlUserDefinedFunctionResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL userDefinedFunction + attr_accessor :id + + # @return [String] Body of the User Defined Function + attr_accessor :body + + + # + # Mapper for SqlUserDefinedFunctionResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionResource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb new file mode 100644 index 000000000..78ed1ecab --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to create and update Cosmos DB Table. + # + class TableCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [TableResource] The standard JSON format of a Table + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for TableCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'TableCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'TableResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb new file mode 100644 index 000000000..295326798 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class TableGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for TableGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableGetProperties_options', + type: { + name: 'Composite', + class_name: 'TableGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb new file mode 100644 index 000000000..6082d2542 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class TableGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB table + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for TableGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableGetProperties_resource', + type: { + name: 'Composite', + class_name: 'TableGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb new file mode 100644 index 000000000..adb64fbce --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB Table. + # + class TableGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [TableGetPropertiesResource] + attr_accessor :resource + + # @return [TableGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for TableGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableGetResults', + type: { + name: 'Composite', + class_name: 'TableGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'TableGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'TableGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb new file mode 100644 index 000000000..afe9c89fd --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The List operation response, that contains the Table and their + # properties. + # + class TableListResult + + include MsRestAzure + + # @return [Array] List of Table and their properties. + attr_accessor :value + + + # + # Mapper for TableListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableListResult', + type: { + name: 'Composite', + class_name: 'TableListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TableGetResultsElementType', + type: { + name: 'Composite', + class_name: 'TableGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb new file mode 100644 index 000000000..3e3ad9a8a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB table resource object + # + class TableResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB table + attr_accessor :id + + + # + # Mapper for TableResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableResource', + type: { + name: 'Composite', + class_name: 'TableResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb new file mode 100644 index 000000000..d8b336c0d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB resource throughput policy + # + class ThroughputPolicyResource + + include MsRestAzure + + # @return [Boolean] Determines whether the ThroughputPolicy is active or + # not + attr_accessor :is_enabled + + # @return [Integer] Represents the percentage by which throughput can + # increase every time throughput policy kicks in. + attr_accessor :increment_percent + + + # + # Mapper for ThroughputPolicyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputPolicyResource', + type: { + name: 'Composite', + class_name: 'ThroughputPolicyResource', + model_properties: { + is_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'isEnabled', + type: { + name: 'Boolean' + } + }, + increment_percent: { + client_side_validation: true, + required: false, + serialized_name: 'incrementPercent', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb new file mode 100644 index 000000000..738a1ac03 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb @@ -0,0 +1,125 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Model object. + # + # + class ThroughputSettingsGetPropertiesResource + + include MsRestAzure + + # @return [Integer] Value of the Cosmos DB resource throughput. Either + # throughput is required or provisionedThroughputSettings is required, + # but not both. + attr_accessor :throughput + + # @return [ProvisionedThroughputSettingsResource] Cosmos DB resource for + # provisioned throughput settings. Either throughput is required or + # provisionedThroughputSettings is required, but not both. + attr_accessor :provisioned_throughput_settings + + # @return [String] The minimum throughput of the resource + attr_accessor :minimum_throughput + + # @return [String] The throughput replace is pending + attr_accessor :offer_replace_pending + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for ThroughputSettingsGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsGetProperties_resource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsGetPropertiesResource', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + provisioned_throughput_settings: { + client_side_validation: true, + required: false, + serialized_name: 'provisionedThroughputSettings', + type: { + name: 'Composite', + class_name: 'ProvisionedThroughputSettingsResource' + } + }, + minimum_throughput: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimumThroughput', + type: { + name: 'String' + } + }, + offer_replace_pending: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'offerReplacePending', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb new file mode 100644 index 000000000..7761f6144 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # An Azure Cosmos DB resource throughput. + # + class ThroughputSettingsGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [ThroughputSettingsGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for ThroughputSettingsGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsGetResults', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb new file mode 100644 index 000000000..670cc38f1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb @@ -0,0 +1,87 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Cosmos DB resource throughput object. Either throughput is required or + # provisionedThroughputSettings is required, but not both. + # + class ThroughputSettingsResource + + include MsRestAzure + + # @return [Integer] Value of the Cosmos DB resource throughput. Either + # throughput is required or provisionedThroughputSettings is required, + # but not both. + attr_accessor :throughput + + # @return [ProvisionedThroughputSettingsResource] Cosmos DB resource for + # provisioned throughput settings. Either throughput is required or + # provisionedThroughputSettings is required, but not both. + attr_accessor :provisioned_throughput_settings + + # @return [String] The minimum throughput of the resource + attr_accessor :minimum_throughput + + # @return [String] The throughput replace is pending + attr_accessor :offer_replace_pending + + + # + # Mapper for ThroughputSettingsResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsResource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsResource', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + provisioned_throughput_settings: { + client_side_validation: true, + required: false, + serialized_name: 'provisionedThroughputSettings', + type: { + name: 'Composite', + class_name: 'ProvisionedThroughputSettingsResource' + } + }, + minimum_throughput: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimumThroughput', + type: { + name: 'String' + } + }, + offer_replace_pending: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'offerReplacePending', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb new file mode 100644 index 000000000..37e7b4df1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb @@ -0,0 +1,99 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Parameters to update Cosmos DB resource throughput. + # + class ThroughputSettingsUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [ThroughputSettingsResource] The standard JSON format of a + # resource throughput + attr_accessor :resource + + + # + # Mapper for ThroughputSettingsUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsUpdateParameters', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb new file mode 100644 index 000000000..60721a5c8 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb @@ -0,0 +1,92 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The resource model definition for a ARM tracked top level resource + # + class TrackedResource < Resource + + include MsRestAzure + + # @return [Hash{String => String}] Resource tags. + attr_accessor :tags + + # @return [String] The geo-location where the resource lives + attr_accessor :location + + + # + # Mapper for TrackedResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TrackedResource', + type: { + name: 'Composite', + class_name: 'TrackedResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb new file mode 100644 index 000000000..5cd60a283 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for TriggerOperation + # + module TriggerOperation + All = "All" + Create = "Create" + Update = "Update" + Delete = "Delete" + Replace = "Replace" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb new file mode 100644 index 000000000..cd12606b4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for TriggerType + # + module TriggerType + Pre = "Pre" + Post = "Post" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb new file mode 100644 index 000000000..31ff91bd0 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The unique key on that enforces uniqueness constraint on documents in the + # collection in the Azure Cosmos DB service. + # + class UniqueKey + + include MsRestAzure + + # @return [Array] List of paths must be unique for each document + # in the Azure Cosmos DB service + attr_accessor :paths + + + # + # Mapper for UniqueKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UniqueKey', + type: { + name: 'Composite', + class_name: 'UniqueKey', + model_properties: { + paths: { + client_side_validation: true, + required: false, + serialized_name: 'paths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb new file mode 100644 index 000000000..f669f1dff --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The unique key policy configuration for specifying uniqueness constraints + # on documents in the collection in the Azure Cosmos DB service. + # + class UniqueKeyPolicy + + include MsRestAzure + + # @return [Array] List of unique keys on that enforces + # uniqueness constraint on documents in the collection in the Azure + # Cosmos DB service. + attr_accessor :unique_keys + + + # + # Mapper for UniqueKeyPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy', + model_properties: { + unique_keys: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'UniqueKeyElementType', + type: { + name: 'Composite', + class_name: 'UniqueKey' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb new file mode 100644 index 000000000..1dcd7df97 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb @@ -0,0 +1,21 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Defines values for UnitType + # + module UnitType + Count = "Count" + Bytes = "Bytes" + Seconds = "Seconds" + Percent = "Percent" + CountPerSecond = "CountPerSecond" + BytesPerSecond = "BytesPerSecond" + Milliseconds = "Milliseconds" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/usage.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/usage.rb new file mode 100644 index 000000000..7176cbb57 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/usage.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The usage data for a usage request. + # + class Usage + + include MsRestAzure + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + # @return [String] The quota period used to summarize the usage values. + attr_accessor :quota_period + + # @return [Integer] Maximum value for this metric + attr_accessor :limit + + # @return [Integer] Current value for this metric + attr_accessor :current_value + + + # + # Mapper for Usage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Usage', + type: { + name: 'Composite', + class_name: 'Usage', + model_properties: { + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + quota_period: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'quotaPeriod', + type: { + name: 'String' + } + }, + limit: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'limit', + type: { + name: 'Number' + } + }, + current_value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'currentValue', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb new file mode 100644 index 000000000..b1df3b759 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # The response to a list usage request. + # + class UsagesResult + + include MsRestAzure + + # @return [Array] The list of usages for the database. A usage is + # a point in time metric + attr_accessor :value + + + # + # Mapper for UsagesResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UsagesResult', + type: { + name: 'Composite', + class_name: 'UsagesResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'UsageElementType', + type: { + name: 'Composite', + class_name: 'Usage' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb new file mode 100644 index 000000000..e826f6543 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + module Models + # + # Virtual Network ACL Rule object + # + class VirtualNetworkRule + + include MsRestAzure + + # @return [String] Resource ID of a subnet, for example: + # /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + attr_accessor :id + + # @return [Boolean] Create firewall rule before the virtual network has + # vnet service endpoint enabled. + attr_accessor :ignore_missing_vnet_service_endpoint + + + # + # Mapper for VirtualNetworkRule class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRule', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + ignore_missing_vnet_service_endpoint: { + client_side_validation: true, + required: false, + serialized_name: 'ignoreMissingVNetServiceEndpoint', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/module_definition.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/module_definition.rb new file mode 100644 index 000000000..08390ac2d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/module_definition.rb @@ -0,0 +1,9 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::Cosmosdb end +module Azure::Cosmosdb::Mgmt end +module Azure::Cosmosdb::Mgmt::V2020_03_01 end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb new file mode 100644 index 000000000..f3231df67 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb @@ -0,0 +1,1706 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class MongoDBResources + include MsRestAzure + + # + # Creates and initializes a new instance of the MongoDBResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the MongoDB databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseListResult] operation results. + # + def list_mongo_dbdatabases(resource_group_name, account_name, custom_headers:nil) + response = list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the MongoDB databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_mongo_dbdatabases_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the MongoDB databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MongoDBDatabaseListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the MongoDB databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseGetResults] operation results. + # + def get_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the MongoDB databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the MongoDB databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MongoDBDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseGetResults] operation results. + # + def create_update_mongo_dbdatabase(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + response = create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MongoDBDatabaseGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) + response = delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) + # Send request + promise = begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the MongoDB database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the MongoDB database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbdatabase_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the MongoDB database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionListResult] operation results. + # + def list_mongo_dbcollections(resource_group_name, account_name, database_name, custom_headers:nil) + response = list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_mongo_dbcollections_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Lists the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MongoDBCollectionListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionGetResults] operation results. + # + def get_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + end + + # + # Gets the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MongoDBCollectionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionGetResults] operation results. + # + def create_update_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + response = create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MongoDBCollectionGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + # Send request + promise = begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the MongoDB collection under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the MongoDB collection under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbcollection_throughput_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the MongoDB collection under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + response = update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseGetResults] operation results. + # + def begin_create_update_mongo_dbdatabase(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + response = begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_mongo_dbdatabase_parameters is nil' if create_update_mongo_dbdatabase_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MongoDBDatabaseCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_mongo_dbdatabase_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MongoDBDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) + response = begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_mongo_dbdatabase_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionGetResults] operation results. + # + def begin_create_update_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + response = begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_mongo_dbcollection_parameters is nil' if create_update_mongo_dbcollection_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MongoDBCollectionCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_mongo_dbcollection_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::MongoDBCollectionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_mongo_dbcollection_throughput_with_http_info(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb new file mode 100644 index 000000000..aa492e2cf --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb @@ -0,0 +1,907 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class NotebookWorkspaces + include MsRestAzure + + # + # Creates and initializes a new instance of the NotebookWorkspaces class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Gets the notebook workspace resources of an existing Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspaceListResult] operation results. + # + def list_by_database_account(resource_group_name, account_name, custom_headers:nil) + response = list_by_database_account_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the notebook workspace resources of an existing Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_database_account_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_by_database_account_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Gets the notebook workspace resources of an existing Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_database_account_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::NotebookWorkspaceListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspace] operation results. + # + def get(resource_group_name, account_name, custom_headers:nil) + response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, account_name, custom_headers:nil) + get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Gets the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::NotebookWorkspace.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspace] operation results. + # + def create_or_update(resource_group_name, account_name, custom_headers:nil) + response = create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::NotebookWorkspace.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, account_name, custom_headers:nil) + response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Retrieves the connection info for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspaceConnectionInfoResult] operation results. + # + def list_connection_info(resource_group_name, account_name, custom_headers:nil) + response = list_connection_info_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the connection info for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_connection_info_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_connection_info_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Retrieves the connection info for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_connection_info_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::NotebookWorkspaceConnectionInfoResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def regenerate_auth_token(resource_group_name, account_name, custom_headers:nil) + response = regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def regenerate_auth_token_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def start(resource_group_name, account_name, custom_headers:nil) + response = start_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def start_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_start_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspace] operation results. + # + def begin_create_or_update(resource_group_name, account_name, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + notebook_create_update_parameters = NotebookWorkspaceCreateUpdateParameters.new + unless + end + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::NotebookWorkspaceCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, notebook_create_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::NotebookWorkspace.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, account_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_regenerate_auth_token(resource_group_name, account_name, custom_headers:nil) + response = begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_regenerate_auth_token_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_start(resource_group_name, account_name, custom_headers:nil) + response = begin_start_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_start_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_start_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_start_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/operations.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/operations.rb new file mode 100644 index 000000000..723656fb0 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/operations.rb @@ -0,0 +1,220 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Operations + include MsRestAzure + + # + # Creates and initializes a new instance of the Operations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers:nil) + first_page = list_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.DocumentDB/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::OperationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::OperationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb new file mode 100644 index 000000000..b6cb51cce --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb @@ -0,0 +1,161 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PartitionKeyRangeId + include MsRestAzure + + # + # Creates and initializes a new instance of the PartitionKeyRangeId class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, 'partition_key_range_id is nil' if partition_key_range_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid,'partitionKeyRangeId' => partition_key_range_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb new file mode 100644 index 000000000..874f3627d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb @@ -0,0 +1,168 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PartitionKeyRangeIdRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the PartitionKeyRangeIdRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, 'partition_key_range_id is nil' if partition_key_range_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region,'databaseRid' => database_rid,'collectionRid' => collection_rid,'partitionKeyRangeId' => partition_key_range_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile.rb new file mode 100644 index 000000000..0a43cfea4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile.rb @@ -0,0 +1,146 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Percentile + include MsRestAzure + + # + # Creates and initializes a new instance of the Percentile class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PercentileMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::PercentileMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb new file mode 100644 index 000000000..5ac369c88 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb @@ -0,0 +1,163 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PercentileSourceTarget + include MsRestAzure + + # + # Creates and initializes a new instance of the PercentileSourceTarget class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given account, + # source and target region. This url is only for PBS and Replication Latency + # data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param source_region [String] Source region from which data is written. + # Cosmos DB region, with spaces between words and each word capitalized. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PercentileMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, source_region, target_region, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, source_region, target_region, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given account, + # source and target region. This url is only for PBS and Replication Latency + # data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param source_region [String] Source region from which data is written. + # Cosmos DB region, with spaces between words and each word capitalized. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, source_region, target_region, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, source_region, target_region, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given account, + # source and target region. This url is only for PBS and Replication Latency + # data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param source_region [String] Source region from which data is written. + # Cosmos DB region, with spaces between words and each word capitalized. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, source_region, target_region, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'source_region is nil' if source_region.nil? + fail ArgumentError, 'target_region is nil' if target_region.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'sourceRegion' => source_region,'targetRegion' => target_region}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::PercentileMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile_target.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile_target.rb new file mode 100644 index 000000000..125669d27 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/percentile_target.rb @@ -0,0 +1,153 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PercentileTarget + include MsRestAzure + + # + # Creates and initializes a new instance of the PercentileTarget class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given account + # target region. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PercentileMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, target_region, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, target_region, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given account + # target region. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, target_region, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, target_region, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given account + # target region. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, target_region, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'target_region is nil' if target_region.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'targetRegion' => target_region}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::PercentileMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/sql_resources.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/sql_resources.rb new file mode 100644 index 000000000..97f3c226d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/sql_resources.rb @@ -0,0 +1,3433 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class SqlResources + include MsRestAzure + + # + # Creates and initializes a new instance of the SqlResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the SQL databases under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseListResult] operation results. + # + def list_sql_databases(resource_group_name, account_name, custom_headers:nil) + response = list_sql_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL databases under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_databases_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_sql_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL databases under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_databases_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlDatabaseListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL database under an existing Azure Cosmos DB database account with + # the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseGetResults] operation results. + # + def get_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL database under an existing Azure Cosmos DB database account with + # the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL database under an existing Azure Cosmos DB database account with + # the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseGetResults] operation results. + # + def create_update_sql_database(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + response = create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlDatabaseGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the SQL database under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_sql_database_throughput(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the SQL database under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_database_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the SQL database under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_sql_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerListResult] operation results. + # + def list_sql_containers(resource_group_name, account_name, database_name, custom_headers:nil) + response = list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_containers_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlContainerListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerGetResults] operation results. + # + def get_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlContainerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerGetResults] operation results. + # + def create_update_sql_container(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + response = create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlContainerGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the SQL container under an existing Azure Cosmos + # DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_sql_container_throughput(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the SQL container under an existing Azure Cosmos + # DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_container_throughput_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the SQL container under an existing Azure Cosmos + # DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_sql_container_throughput(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + response = update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureListResult] operation results. + # + def list_sql_stored_procedures(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = list_sql_stored_procedures_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_stored_procedures_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + list_sql_stored_procedures_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_stored_procedures_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlStoredProcedureListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureGetResults] operation results. + # + def get_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + response = get_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + get_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'stored_procedure_name is nil' if stored_procedure_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlStoredProcedureGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureGetResults] operation results. + # + def create_update_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + response = create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlStoredProcedureGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + response = delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionListResult] operation results. + # + def list_sql_user_defined_functions(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = list_sql_user_defined_functions_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_user_defined_functions_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + list_sql_user_defined_functions_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_user_defined_functions_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlUserDefinedFunctionListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionGetResults] operation results. + # + def get_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + response = get_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + get_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'user_defined_function_name is nil' if user_defined_function_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlUserDefinedFunctionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionGetResults] operation results. + # + def create_update_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + response = create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlUserDefinedFunctionGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + response = delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerListResult] operation results. + # + def list_sql_triggers(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = list_sql_triggers_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_triggers_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + list_sql_triggers_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_triggers_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlTriggerListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerGetResults] operation results. + # + def get_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + response = get_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + get_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'trigger_name is nil' if trigger_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlTriggerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerGetResults] operation results. + # + def create_update_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + response = create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlTriggerGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + response = delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseGetResults] operation results. + # + def begin_create_update_sql_database(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + response = begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_database_with_http_info(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_sql_database_parameters is nil' if create_update_sql_database_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlDatabaseCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_database_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_sql_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_sql_database_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerGetResults] operation results. + # + def begin_create_update_sql_container(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + response = begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_sql_container_parameters is nil' if create_update_sql_container_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlContainerCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_container_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlContainerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_sql_container_throughput(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_sql_container_throughput_with_http_info(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureGetResults] operation results. + # + def begin_create_update_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + response = begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'stored_procedure_name is nil' if stored_procedure_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_sql_stored_procedure_parameters is nil' if create_update_sql_stored_procedure_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlStoredProcedureCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_stored_procedure_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlStoredProcedureGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + response = begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'stored_procedure_name is nil' if stored_procedure_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionGetResults] operation results. + # + def begin_create_update_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + response = begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'user_defined_function_name is nil' if user_defined_function_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_sql_user_defined_function_parameters is nil' if create_update_sql_user_defined_function_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlUserDefinedFunctionCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_user_defined_function_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlUserDefinedFunctionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + response = begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'user_defined_function_name is nil' if user_defined_function_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerGetResults] operation results. + # + def begin_create_update_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + response = begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'trigger_name is nil' if trigger_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_sql_trigger_parameters is nil' if create_update_sql_trigger_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlTriggerCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_trigger_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::SqlTriggerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + response = begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'trigger_name is nil' if trigger_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/table_resources.rb b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/table_resources.rb new file mode 100644 index 000000000..1b71d204d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-03-01/generated/azure_mgmt_cosmosdb/table_resources.rb @@ -0,0 +1,840 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_03_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class TableResources + include MsRestAzure + + # + # Creates and initializes a new instance of the TableResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the Tables under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableListResult] operation results. + # + def list_tables(resource_group_name, account_name, custom_headers:nil) + response = list_tables_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Tables under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_tables_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_tables_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the Tables under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_tables_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::TableListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Tables under an existing Azure Cosmos DB database account with the + # provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableGetResults] operation results. + # + def get_table(resource_group_name, account_name, table_name, custom_headers:nil) + response = get_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Tables under an existing Azure Cosmos DB database account with the + # provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_table_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) + get_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the Tables under an existing Azure Cosmos DB database account with the + # provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_table_async(resource_group_name, account_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::TableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableGetResults] operation results. + # + def create_update_table(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + response = create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::TableGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_table(resource_group_name, account_name, table_name, custom_headers:nil) + response = delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_table_async(resource_group_name, account_name, table_name, custom_headers:nil) + # Send request + promise = begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Table under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_table_throughput(resource_group_name, account_name, table_name, custom_headers:nil) + response = get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Table under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_table_throughput_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) + get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Table under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_table_throughput(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + response = update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableGetResults] operation results. + # + def begin_create_update_table(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + response = begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_table_with_http_info(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_table_parameters is nil' if create_update_table_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::TableCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_table_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::TableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_table(resource_group_name, account_name, table_name, custom_headers:nil) + response = begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_table_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) + begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_table_throughput(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_table_throughput_with_http_info(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb.rb new file mode 100644 index 000000000..403b71c58 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb.rb @@ -0,0 +1,212 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require '2020-04-01/generated/azure_mgmt_cosmosdb/module_definition' +require 'ms_rest_azure' + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + autoload :DatabaseAccounts, '2020-04-01/generated/azure_mgmt_cosmosdb/database_accounts.rb' + autoload :Operations, '2020-04-01/generated/azure_mgmt_cosmosdb/operations.rb' + autoload :Database, '2020-04-01/generated/azure_mgmt_cosmosdb/database.rb' + autoload :Collection, '2020-04-01/generated/azure_mgmt_cosmosdb/collection.rb' + autoload :CollectionRegion, '2020-04-01/generated/azure_mgmt_cosmosdb/collection_region.rb' + autoload :DatabaseAccountRegion, '2020-04-01/generated/azure_mgmt_cosmosdb/database_account_region.rb' + autoload :PercentileSourceTarget, '2020-04-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb' + autoload :PercentileTarget, '2020-04-01/generated/azure_mgmt_cosmosdb/percentile_target.rb' + autoload :Percentile, '2020-04-01/generated/azure_mgmt_cosmosdb/percentile.rb' + autoload :CollectionPartitionRegion, '2020-04-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb' + autoload :CollectionPartition, '2020-04-01/generated/azure_mgmt_cosmosdb/collection_partition.rb' + autoload :PartitionKeyRangeId, '2020-04-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb' + autoload :PartitionKeyRangeIdRegion, '2020-04-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb' + autoload :SqlResources, '2020-04-01/generated/azure_mgmt_cosmosdb/sql_resources.rb' + autoload :MongoDBResources, '2020-04-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb' + autoload :TableResources, '2020-04-01/generated/azure_mgmt_cosmosdb/table_resources.rb' + autoload :CassandraResources, '2020-04-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb' + autoload :GremlinResources, '2020-04-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb' + autoload :NotebookWorkspaces, '2020-04-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb' + autoload :CosmosDBManagementClient, '2020-04-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb' + + module Models + autoload :ErrorResponse, '2020-04-01/generated/azure_mgmt_cosmosdb/models/error_response.rb' + autoload :IpAddressOrRange, '2020-04-01/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb' + autoload :FailoverPolicies, '2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb' + autoload :Capability, '2020-04-01/generated/azure_mgmt_cosmosdb/models/capability.rb' + autoload :RegionForOnlineOffline, '2020-04-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb' + autoload :FailoverPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb' + autoload :ARMResourceProperties, '2020-04-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb' + autoload :PrivateEndpointProperty, '2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb' + autoload :ARMProxyResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb' + autoload :PartitionUsagesResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb' + autoload :UsagesResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb' + autoload :CassandraKeyspaceListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb' + autoload :SqlDatabaseGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb' + autoload :Column, '2020-04-01/generated/azure_mgmt_cosmosdb/models/column.rb' + autoload :NotebookWorkspaceListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb' + autoload :CassandraPartitionKey, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb' + autoload :Indexes, '2020-04-01/generated/azure_mgmt_cosmosdb/models/indexes.rb' + autoload :ClusterKey, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb' + autoload :ExcludedPath, '2020-04-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb' + autoload :CassandraSchema, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb' + autoload :SpatialSpec, '2020-04-01/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb' + autoload :CassandraTableGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb' + autoload :ContainerPartitionKey, '2020-04-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb' + autoload :Usage, '2020-04-01/generated/azure_mgmt_cosmosdb/models/usage.rb' + autoload :UniqueKeyPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb' + autoload :MetricName, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb' + autoload :SqlContainerGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb' + autoload :CassandraTableListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb' + autoload :Resource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/resource.rb' + autoload :GremlinDatabaseGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb' + autoload :SqlStoredProcedureGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb' + autoload :OperationListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb' + autoload :SqlStoredProcedureListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb' + autoload :Operation, '2020-04-01/generated/azure_mgmt_cosmosdb/models/operation.rb' + autoload :PercentileMetricListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb' + autoload :GremlinDatabaseListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb' + autoload :SqlTriggerGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb' + autoload :GremlinGraphGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb' + autoload :SqlTriggerListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb' + autoload :OperationDisplay, '2020-04-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb' + autoload :MetricListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb' + autoload :OptionsResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb' + autoload :MongoDBDatabaseListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb' + autoload :GremlinGraphListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb' + autoload :MongoIndexOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb' + autoload :ConsistencyPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb' + autoload :MongoDBCollectionGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb' + autoload :Location, '2020-04-01/generated/azure_mgmt_cosmosdb/models/location.rb' + autoload :MetricDefinitionsListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb' + autoload :VirtualNetworkRule, '2020-04-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb' + autoload :TableGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb' + autoload :PrivateLinkServiceConnectionStateProperty, '2020-04-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb' + autoload :MetricAvailability, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb' + autoload :GremlinGraphResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb' + autoload :CassandraKeyspaceGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb' + autoload :ExtendedResourceProperties, '2020-04-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb' + autoload :DatabaseAccountsListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb' + autoload :ThroughputPolicyResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb' + autoload :SqlDatabaseListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb' + autoload :AutoUpgradePolicyResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb' + autoload :CompositePath, '2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb' + autoload :AutoscaleSettingsResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings_resource.rb' + autoload :UniqueKey, '2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb' + autoload :ThroughputSettingsGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb' + autoload :SqlUserDefinedFunctionResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb' + autoload :SqlContainerListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb' + autoload :GremlinDatabaseResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb' + autoload :SqlUserDefinedFunctionGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb' + autoload :CassandraTableResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb' + autoload :PercentileMetric, '2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb' + autoload :DatabaseAccountUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb' + autoload :Metric, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric.rb' + autoload :DatabaseAccountListReadOnlyKeysResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb' + autoload :MongoIndex, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb' + autoload :CassandraKeyspaceResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb' + autoload :MongoDBCollectionListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb' + autoload :DatabaseAccountConnectionString, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb' + autoload :TableListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb' + autoload :DatabaseAccountListConnectionStringsResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb' + autoload :NotebookWorkspaceConnectionInfoResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb' + autoload :DatabaseAccountRegenerateKeyParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb' + autoload :IndexingPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb' + autoload :ThroughputSettingsResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb' + autoload :PartitionMetricListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb' + autoload :TableResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb' + autoload :MongoDBDatabaseGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb' + autoload :SqlDatabaseResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb' + autoload :MetricValue, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb' + autoload :AutoscaleSettings, '2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings.rb' + autoload :ApiProperties, '2020-04-01/generated/azure_mgmt_cosmosdb/models/api_properties.rb' + autoload :CreateUpdateOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb' + autoload :ConflictResolutionPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb' + autoload :MongoDBCollectionResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb' + autoload :MongoIndexKeys, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb' + autoload :SqlContainerResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb' + autoload :IncludedPath, '2020-04-01/generated/azure_mgmt_cosmosdb/models/included_path.rb' + autoload :MongoDBDatabaseResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb' + autoload :MetricDefinition, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb' + autoload :SqlStoredProcedureResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb' + autoload :SqlUserDefinedFunctionListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb' + autoload :SqlTriggerResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb' + autoload :ProxyResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb' + autoload :PrivateEndpointConnection, '2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb' + autoload :DatabaseAccountGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb' + autoload :SqlDatabaseGetPropertiesOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb' + autoload :SqlDatabaseGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb' + autoload :SqlContainerGetPropertiesOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb' + autoload :SqlContainerGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb' + autoload :SqlStoredProcedureGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb' + autoload :SqlUserDefinedFunctionGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb' + autoload :SqlTriggerGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb' + autoload :MongoDBDatabaseGetPropertiesOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb' + autoload :MongoDBDatabaseGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb' + autoload :MongoDBCollectionGetPropertiesOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb' + autoload :MongoDBCollectionGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb' + autoload :TableGetPropertiesOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb' + autoload :TableGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb' + autoload :CassandraKeyspaceGetPropertiesOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb' + autoload :CassandraKeyspaceGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb' + autoload :CassandraTableGetPropertiesOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb' + autoload :CassandraTableGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb' + autoload :GremlinDatabaseGetPropertiesOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb' + autoload :GremlinDatabaseGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb' + autoload :GremlinGraphGetPropertiesOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb' + autoload :GremlinGraphGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb' + autoload :ThroughputSettingsGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb' + autoload :DatabaseAccountCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb' + autoload :DatabaseAccountListKeysResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb' + autoload :ThroughputSettingsUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb' + autoload :SqlDatabaseCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb' + autoload :SqlContainerCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb' + autoload :SqlStoredProcedureCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb' + autoload :SqlUserDefinedFunctionCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb' + autoload :SqlTriggerCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb' + autoload :MongoDBDatabaseCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb' + autoload :MongoDBCollectionCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb' + autoload :TableCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb' + autoload :CassandraKeyspaceCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb' + autoload :CassandraTableCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb' + autoload :GremlinDatabaseCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb' + autoload :GremlinGraphCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb' + autoload :PartitionUsage, '2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb' + autoload :PercentileMetricValue, '2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb' + autoload :PartitionMetric, '2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb' + autoload :TrackedResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb' + autoload :AzureEntityResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb' + autoload :NotebookWorkspaceCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb' + autoload :NotebookWorkspace, '2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb' + autoload :DatabaseAccountKind, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb' + autoload :DatabaseAccountOfferType, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb' + autoload :DefaultConsistencyLevel, '2020-04-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb' + autoload :ConnectorOffer, '2020-04-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb' + autoload :PublicNetworkAccess, '2020-04-01/generated/azure_mgmt_cosmosdb/models/public_network_access.rb' + autoload :ServerVersion, '2020-04-01/generated/azure_mgmt_cosmosdb/models/server_version.rb' + autoload :IndexingMode, '2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb' + autoload :DataType, '2020-04-01/generated/azure_mgmt_cosmosdb/models/data_type.rb' + autoload :IndexKind, '2020-04-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb' + autoload :CompositePathSortOrder, '2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb' + autoload :SpatialType, '2020-04-01/generated/azure_mgmt_cosmosdb/models/spatial_type.rb' + autoload :PartitionKind, '2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb' + autoload :ConflictResolutionMode, '2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb' + autoload :TriggerType, '2020-04-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb' + autoload :TriggerOperation, '2020-04-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb' + autoload :KeyKind, '2020-04-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb' + autoload :UnitType, '2020-04-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb' + autoload :PrimaryAggregationType, '2020-04-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb' + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb new file mode 100644 index 000000000..d04d29074 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb @@ -0,0 +1,1700 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CassandraResources + include MsRestAzure + + # + # Creates and initializes a new instance of the CassandraResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceListResult] operation results. + # + def list_cassandra_keyspaces(resource_group_name, account_name, custom_headers:nil) + response = list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_cassandra_keyspaces_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraKeyspaceListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceGetResults] operation results. + # + def get_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraKeyspaceGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceGetResults] operation results. + # + def create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + response = create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraKeyspaceGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + # Send request + promise = begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Cassandra Keyspace under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Cassandra Keyspace under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Cassandra Keyspace under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + response = update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableListResult] operation results. + # + def list_cassandra_tables(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_cassandra_tables_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Lists the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraTableListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableGetResults] operation results. + # + def get_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the Cassandra table under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraTableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableGetResults] operation results. + # + def create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + response = create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraTableGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + # Send request + promise = begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos + # DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos + # DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos + # DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + response = update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraKeyspaceGetResults] operation results. + # + def begin_create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + response = begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Cassandra keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param create_update_cassandra_keyspace_parameters + # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the + # current Cassandra keyspace. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_cassandra_keyspace_parameters is nil' if create_update_cassandra_keyspace_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraKeyspaceCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_cassandra_keyspace_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraKeyspaceGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) + response = begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) + begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Cassandra keyspace. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra + # Keyspace. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CassandraTableGetResults] operation results. + # + def begin_create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + response = begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Cassandra Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_cassandra_table_parameters + # [CassandraTableCreateUpdateParameters] The parameters to provide for the + # current Cassandra Table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_cassandra_table_parameters is nil' if create_update_cassandra_table_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraTableCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_cassandra_table_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraTableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + response = begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Cassandra table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Cassandra table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param keyspace_name [String] Cosmos DB keyspace name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Cassandra table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection.rb new file mode 100644 index 000000000..b99306886 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection.rb @@ -0,0 +1,389 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Collection + include MsRestAzure + + # + # Creates and initializes a new instance of the Collection class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account and collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent storage data) for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent storage data) for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent storage data) for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::UsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves metric definitions for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricDefinitionsListResult] operation results. + # + def list_metric_definitions(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil) + response = list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves metric definitions for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metric_definitions_with_http_info(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil) + list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:custom_headers).value! + end + + # + # Retrieves metric definitions for the given collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MetricDefinitionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_partition.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_partition.rb new file mode 100644 index 000000000..018df1d7d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_partition.rb @@ -0,0 +1,279 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CollectionPartition + include MsRestAzure + + # + # Creates and initializes a new instance of the CollectionPartition class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given + # collection, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given + # collection, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given + # collection, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent storage data) for the given collection, + # split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionUsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent storage data) for the given collection, + # split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent storage data) for the given collection, + # split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::PartitionUsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb new file mode 100644 index 000000000..62f8b4fc4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb @@ -0,0 +1,161 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CollectionPartitionRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the CollectionPartitionRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given collection + # and region, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given collection + # and region, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given collection + # and region, split by partition. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_region.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_region.rb new file mode 100644 index 000000000..d92543fce --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/collection_region.rb @@ -0,0 +1,161 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class CollectionRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the CollectionRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account, collection and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account, collection and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account, collection and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region,'databaseRid' => database_rid,'collectionRid' => collection_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb new file mode 100644 index 000000000..1c9d8a5cf --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb @@ -0,0 +1,203 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # A service client - single point of access to the REST API. + # + class CosmosDBManagementClient < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] The API version to use for this operation. + attr_reader :api_version + + # @return [String] The ID of the target subscription. + attr_accessor :subscription_id + + # @return [String] The preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] The retry timeout in seconds for Long Running + # Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] Whether a unique x-ms-client-request-id should be + # generated. When set to true a unique x-ms-client-request-id value is + # generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [DatabaseAccounts] database_accounts + attr_reader :database_accounts + + # @return [Operations] operations + attr_reader :operations + + # @return [Database] database + attr_reader :database + + # @return [Collection] collection + attr_reader :collection + + # @return [CollectionRegion] collection_region + attr_reader :collection_region + + # @return [DatabaseAccountRegion] database_account_region + attr_reader :database_account_region + + # @return [PercentileSourceTarget] percentile_source_target + attr_reader :percentile_source_target + + # @return [PercentileTarget] percentile_target + attr_reader :percentile_target + + # @return [Percentile] percentile + attr_reader :percentile + + # @return [CollectionPartitionRegion] collection_partition_region + attr_reader :collection_partition_region + + # @return [CollectionPartition] collection_partition + attr_reader :collection_partition + + # @return [PartitionKeyRangeId] partition_key_range_id + attr_reader :partition_key_range_id + + # @return [PartitionKeyRangeIdRegion] partition_key_range_id_region + attr_reader :partition_key_range_id_region + + # @return [SqlResources] sql_resources + attr_reader :sql_resources + + # @return [MongoDBResources] mongo_dbresources + attr_reader :mongo_dbresources + + # @return [TableResources] table_resources + attr_reader :table_resources + + # @return [CassandraResources] cassandra_resources + attr_reader :cassandra_resources + + # @return [GremlinResources] gremlin_resources + attr_reader :gremlin_resources + + # @return [NotebookWorkspaces] notebook_workspaces + attr_reader :notebook_workspaces + + # + # Creates initializes a new instance of the CosmosDBManagementClient class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @database_accounts = DatabaseAccounts.new(self) + @operations = Operations.new(self) + @database = Database.new(self) + @collection = Collection.new(self) + @collection_region = CollectionRegion.new(self) + @database_account_region = DatabaseAccountRegion.new(self) + @percentile_source_target = PercentileSourceTarget.new(self) + @percentile_target = PercentileTarget.new(self) + @percentile = Percentile.new(self) + @collection_partition_region = CollectionPartitionRegion.new(self) + @collection_partition = CollectionPartition.new(self) + @partition_key_range_id = PartitionKeyRangeId.new(self) + @partition_key_range_id_region = PartitionKeyRangeIdRegion.new(self) + @sql_resources = SqlResources.new(self) + @mongo_dbresources = MongoDBResources.new(self) + @table_resources = TableResources.new(self) + @cassandra_resources = CassandraResources.new(self) + @gremlin_resources = GremlinResources.new(self) + @notebook_workspaces = NotebookWorkspaces.new(self) + @api_version = '2020-04-01' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) + @request_headers['Content-Type'] = options[:headers]['Content-Type'] + end + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_cosmosdb' + sdk_information = "#{sdk_information}/0.21.2" + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database.rb new file mode 100644 index 000000000..8fa37c31d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database.rb @@ -0,0 +1,377 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Database + include MsRestAzure + + # + # Creates and initializes a new instance of the Database class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account and database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent data) for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, database_rid, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, database_rid, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent data) for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, database_rid, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, database_rid, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent data) for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, database_rid, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::UsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves metric definitions for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricDefinitionsListResult] operation results. + # + def list_metric_definitions(resource_group_name, account_name, database_rid, custom_headers:nil) + response = list_metric_definitions_async(resource_group_name, account_name, database_rid, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves metric definitions for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metric_definitions_with_http_info(resource_group_name, account_name, database_rid, custom_headers:nil) + list_metric_definitions_async(resource_group_name, account_name, database_rid, custom_headers:custom_headers).value! + end + + # + # Retrieves metric definitions for the given database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metric_definitions_async(resource_group_name, account_name, database_rid, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MetricDefinitionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database_account_region.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database_account_region.rb new file mode 100644 index 000000000..53185d196 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database_account_region.rb @@ -0,0 +1,153 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class DatabaseAccountRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the DatabaseAccountRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database_accounts.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database_accounts.rb new file mode 100644 index 000000000..8fe8f6fec --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/database_accounts.rb @@ -0,0 +1,2281 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class DatabaseAccounts + include MsRestAzure + + # + # Creates and initializes a new instance of the DatabaseAccounts class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def get(resource_group_name, account_name, custom_headers:nil) + response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, account_name, custom_headers:nil) + get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Retrieves the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def update(resource_group_name, account_name, update_parameters, custom_headers:nil) + response = update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, account_name, update_parameters, custom_headers:nil) + # Send request + promise = begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def create_or_update(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + response = create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, account_name, custom_headers:nil) + response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def failover_priority_change(resource_group_name, account_name, failover_parameters, custom_headers:nil) + response = failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:nil) + # Send request + promise = begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists all the Azure Cosmos DB database accounts available under the + # subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountsListResult] operation results. + # + def list(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all the Azure Cosmos DB database accounts available under the + # subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Lists all the Azure Cosmos DB database accounts available under the + # subscription. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all the Azure Cosmos DB database accounts available under the given + # resource group. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountsListResult] operation results. + # + def list_by_resource_group(resource_group_name, custom_headers:nil) + response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all the Azure Cosmos DB database accounts available under the given + # resource group. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil) + list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! + end + + # + # Lists all the Azure Cosmos DB database accounts available under the given + # resource group. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, custom_headers:nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists the access keys for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListKeysResult] operation results. + # + def list_keys(resource_group_name, account_name, custom_headers:nil) + response = list_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the access keys for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the access keys for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_keys_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountListKeysResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists the connection strings for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListConnectionStringsResult] operation results. + # + def list_connection_strings(resource_group_name, account_name, custom_headers:nil) + response = list_connection_strings_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the connection strings for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_connection_strings_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_connection_strings_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the connection strings for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_connection_strings_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountListConnectionStringsResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def offline_region(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + response = offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + # Send request + promise = begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def online_region(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + response = online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + # Send request + promise = begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListReadOnlyKeysResult] operation results. + # + def get_read_only_keys(resource_group_name, account_name, custom_headers:nil) + response = get_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_read_only_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) + get_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_read_only_keys_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountListReadOnlyKeysResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountListReadOnlyKeysResult] operation results. + # + def list_read_only_keys(resource_group_name, account_name, custom_headers:nil) + response = list_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_read_only_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the read-only access keys for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_read_only_keys_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountListReadOnlyKeysResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def regenerate_key(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + response = regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + # Send request + promise = begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Checks that the Azure Cosmos DB account name already exists. A valid account + # name may contain only lowercase letters, numbers, and the '-' character, and + # must be between 3 and 50 characters. + # + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Boolean] operation results. + # + def check_name_exists(account_name, custom_headers:nil) + response = check_name_exists_async(account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Checks that the Azure Cosmos DB account name already exists. A valid account + # name may contain only lowercase letters, numbers, and the '-' character, and + # must be between 3 and 50 characters. + # + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def check_name_exists_with_http_info(account_name, custom_headers:nil) + check_name_exists_async(account_name, custom_headers:custom_headers).value! + end + + # + # Checks that the Azure Cosmos DB account name already exists. A valid account + # name may contain only lowercase letters, numbers, and the '-' character, and + # must be between 3 and 50 characters. + # + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def check_name_exists_async(account_name, custom_headers:nil) + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:head, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 404 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.body = (status_code == 200) + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves the usages (most recent data) for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsagesResult] operation results. + # + def list_usages(resource_group_name, account_name, filter:nil, custom_headers:nil) + response = list_usages_async(resource_group_name, account_name, filter:filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the usages (most recent data) for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, account_name, filter:nil, custom_headers:nil) + list_usages_async(resource_group_name, account_name, filter:filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the usages (most recent data) for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # usages to return. The supported parameter is name.value (name of the metric, + # can have an or of multiple names). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, account_name, filter:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::UsagesResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Retrieves metric definitions for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MetricDefinitionsListResult] operation results. + # + def list_metric_definitions(resource_group_name, account_name, custom_headers:nil) + response = list_metric_definitions_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves metric definitions for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metric_definitions_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_metric_definitions_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Retrieves metric definitions for the given database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metric_definitions_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MetricDefinitionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def begin_update(resource_group_name, account_name, update_parameters, custom_headers:nil) + response = begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, account_name, update_parameters, custom_headers:nil) + begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! + end + + # + # Updates the properties of an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to + # provide for the current database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_parameters is nil' if update_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseAccountGetResults] operation results. + # + def begin_create_or_update(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! + end + + # + # Creates or updates an Azure Cosmos DB database account. The "Update" method + # is preferred when performing updates on an account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The + # parameters to provide for the current database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_parameters is nil' if create_update_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, account_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_failover_priority_change(resource_group_name, account_name, failover_parameters, custom_headers:nil) + response = begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! + nil + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_failover_priority_change_with_http_info(resource_group_name, account_name, failover_parameters, custom_headers:nil) + begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! + end + + # + # Changes the failover priority for the Azure Cosmos DB database account. A + # failover priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority values + # must be unique for each of the regions in which the database account exists. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param failover_parameters [FailoverPolicies] The new failover policies for + # the database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'failover_parameters is nil' if failover_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::FailoverPolicies.mapper() + request_content = @client.serialize(request_mapper, failover_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_offline_region(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + response = begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! + nil + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_offline_region_with_http_info(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! + end + + # + # Offline the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region + # to offline for the database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'region_parameter_for_offline is nil' if region_parameter_for_offline.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::RegionForOnlineOffline.mapper() + request_content = @client.serialize(request_mapper, region_parameter_for_offline) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_online_region(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + response = begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! + nil + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_online_region_with_http_info(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! + end + + # + # Online the specified region for the specified Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region + # to online for the database account. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'region_parameter_for_online is nil' if region_parameter_for_online.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::RegionForOnlineOffline.mapper() + request_content = @client.serialize(request_mapper, region_parameter_for_online) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_regenerate_key(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + response = begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! + nil + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_regenerate_key_with_http_info(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! + end + + # + # Regenerates an access key for the specified Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of + # the key to regenerate. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'key_to_regenerate is nil' if key_to_regenerate.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::DatabaseAccountRegenerateKeyParameters.mapper() + request_content = @client.serialize(request_mapper, key_to_regenerate) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb new file mode 100644 index 000000000..6c2dafe9b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb @@ -0,0 +1,1695 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class GremlinResources + include MsRestAzure + + # + # Creates and initializes a new instance of the GremlinResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the Gremlin databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseListResult] operation results. + # + def list_gremlin_databases(resource_group_name, account_name, custom_headers:nil) + response = list_gremlin_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Gremlin databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_gremlin_databases_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_gremlin_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the Gremlin databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_gremlin_databases_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::GremlinDatabaseListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Gremlin databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseGetResults] operation results. + # + def get_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Gremlin databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the Gremlin databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::GremlinDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseGetResults] operation results. + # + def create_update_gremlin_database(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + response = create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::GremlinDatabaseGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + # Send request + promise = begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Gremlin database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_gremlin_database_throughput(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Gremlin database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_database_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Gremlin database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_gremlin_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphListResult] operation results. + # + def list_gremlin_graphs(resource_group_name, account_name, database_name, custom_headers:nil) + response = list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_gremlin_graphs_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Lists the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::GremlinGraphListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphGetResults] operation results. + # + def get_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + end + + # + # Gets the Gremlin graph under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::GremlinGraphGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphGetResults] operation results. + # + def create_update_gremlin_graph(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + response = create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::GremlinGraphGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + # Send request + promise = begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_gremlin_graph_throughput_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + end + + # + # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database + # account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + response = update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinDatabaseGetResults] operation results. + # + def begin_create_update_gremlin_database(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + response = begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_gremlin_database_with_http_info(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_gremlin_database_parameters + # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the + # current Gremlin database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_gremlin_database_parameters is nil' if create_update_gremlin_database_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::GremlinDatabaseCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_gremlin_database_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::GremlinDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_gremlin_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Gremlin database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_gremlin_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_gremlin_database_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GremlinGraphGetResults] operation results. + # + def begin_create_update_gremlin_graph(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + response = begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param create_update_gremlin_graph_parameters + # [GremlinGraphCreateUpdateParameters] The parameters to provide for the + # current Gremlin graph. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_gremlin_graph_parameters is nil' if create_update_gremlin_graph_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::GremlinGraphCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_gremlin_graph_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::GremlinGraphGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + response = begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Gremlin graph. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_gremlin_graph_throughput_with_http_info(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Gremlin graph + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param graph_name [String] Cosmos DB graph name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current Gremlin graph. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'graph_name is nil' if graph_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/api_properties.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/api_properties.rb new file mode 100644 index 000000000..db7eef380 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/api_properties.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class ApiProperties + + include MsRestAzure + + # @return [ServerVersion] Describes the ServerVersion of an a MongoDB + # account. Possible values include: '3.2', '3.6' + attr_accessor :server_version + + + # + # Mapper for ApiProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ApiProperties', + type: { + name: 'Composite', + class_name: 'ApiProperties', + model_properties: { + server_version: { + client_side_validation: true, + required: false, + serialized_name: 'serverVersion', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb new file mode 100644 index 000000000..b6a0d16bc --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The resource model definition for a ARM proxy resource. It will have + # everything other than required location and tags + # + class ARMProxyResource + + include MsRestAzure + + # @return [String] The unique resource identifier of the database + # account. + attr_accessor :id + + # @return [String] The name of the database account. + attr_accessor :name + + # @return [String] The type of Azure resource. + attr_accessor :type + + + # + # Mapper for ARMProxyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ARMProxyResource', + type: { + name: 'Composite', + class_name: 'ARMProxyResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb new file mode 100644 index 000000000..89e3aa94d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb @@ -0,0 +1,102 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The core properties of ARM resources. + # + class ARMResourceProperties + + include MsRestAzure + + # @return [String] The unique resource identifier of the ARM resource. + attr_accessor :id + + # @return [String] The name of the ARM resource. + attr_accessor :name + + # @return [String] The type of Azure resource. + attr_accessor :type + + # @return [String] The location of the resource group to which the + # resource belongs. + attr_accessor :location + + # @return [Hash{String => String}] + attr_accessor :tags + + + # + # Mapper for ARMResourceProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ARMResourceProperties', + type: { + name: 'Composite', + class_name: 'ARMResourceProperties', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb new file mode 100644 index 000000000..c2813d2e9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB resource auto-upgrade policy + # + class AutoUpgradePolicyResource + + include MsRestAzure + + # @return [ThroughputPolicyResource] Represents throughput policy which + # service must adhere to for auto-upgrade + attr_accessor :throughput_policy + + + # + # Mapper for AutoUpgradePolicyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AutoUpgradePolicyResource', + type: { + name: 'Composite', + class_name: 'AutoUpgradePolicyResource', + model_properties: { + throughput_policy: { + client_side_validation: true, + required: false, + serialized_name: 'throughputPolicy', + type: { + name: 'Composite', + class_name: 'ThroughputPolicyResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings.rb new file mode 100644 index 000000000..c79b8acaf --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class AutoscaleSettings + + include MsRestAzure + + # @return [Integer] Represents maximum throughput, the resource can scale + # up to. + attr_accessor :max_throughput + + + # + # Mapper for AutoscaleSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AutoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings', + model_properties: { + max_throughput: { + client_side_validation: true, + required: false, + serialized_name: 'maxThroughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings_resource.rb new file mode 100644 index 000000000..9c38fb986 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings_resource.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB provisioned throughput settings object + # + class AutoscaleSettingsResource + + include MsRestAzure + + # @return [Integer] Represents maximum throughput container can scale up + # to. + attr_accessor :max_throughput + + # @return [AutoUpgradePolicyResource] Cosmos DB resource auto-upgrade + # policy + attr_accessor :auto_upgrade_policy + + # @return [Integer] Represents target maximum throughput container can + # scale up to once offer is no longer in pending state. + attr_accessor :target_max_throughput + + + # + # Mapper for AutoscaleSettingsResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AutoscaleSettingsResource', + type: { + name: 'Composite', + class_name: 'AutoscaleSettingsResource', + model_properties: { + max_throughput: { + client_side_validation: true, + required: true, + serialized_name: 'maxThroughput', + type: { + name: 'Number' + } + }, + auto_upgrade_policy: { + client_side_validation: true, + required: false, + serialized_name: 'autoUpgradePolicy', + type: { + name: 'Composite', + class_name: 'AutoUpgradePolicyResource' + } + }, + target_max_throughput: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'targetMaxThroughput', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb new file mode 100644 index 000000000..7787457a5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb @@ -0,0 +1,75 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The resource model definition for a Azure Resource Manager resource with + # an etag. + # + class AzureEntityResource < Resource + + include MsRestAzure + + # @return [String] Resource Etag. + attr_accessor :etag + + + # + # Mapper for AzureEntityResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AzureEntityResource', + type: { + name: 'Composite', + class_name: 'AzureEntityResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/capability.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/capability.rb new file mode 100644 index 000000000..3f0c1333f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/capability.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB capability object + # + class Capability + + include MsRestAzure + + # @return [String] Name of the Cosmos DB capability. For example, "name": + # "EnableCassandra". Current values also include "EnableTable" and + # "EnableGremlin". + attr_accessor :name + + + # + # Mapper for Capability class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Capability', + type: { + name: 'Composite', + class_name: 'Capability', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb new file mode 100644 index 000000000..1f44c5d39 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB Cassandra keyspace. + # + class CassandraKeyspaceCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraKeyspaceResource] The standard JSON format of a + # Cassandra keyspace + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for CassandraKeyspaceCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb new file mode 100644 index 000000000..95a4a064a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class CassandraKeyspaceGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for CassandraKeyspaceGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceGetProperties_options', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb new file mode 100644 index 000000000..1cf960de0 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class CassandraKeyspaceGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra keyspace + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for CassandraKeyspaceGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceGetProperties_resource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb new file mode 100644 index 000000000..ca2377e93 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB Cassandra keyspace. + # + class CassandraKeyspaceGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraKeyspaceGetPropertiesResource] + attr_accessor :resource + + # @return [CassandraKeyspaceGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for CassandraKeyspaceGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceGetResults', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb new file mode 100644 index 000000000..de7711d8d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the Cassandra keyspaces and + # their properties. + # + class CassandraKeyspaceListResult + + include MsRestAzure + + # @return [Array] List of Cassandra + # keyspaces and their properties. + attr_accessor :value + + + # + # Mapper for CassandraKeyspaceListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceListResult', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceGetResultsElementType', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb new file mode 100644 index 000000000..df401e815 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB Cassandra keyspace resource object + # + class CassandraKeyspaceResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra keyspace + attr_accessor :id + + + # + # Mapper for CassandraKeyspaceResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraKeyspaceResource', + type: { + name: 'Composite', + class_name: 'CassandraKeyspaceResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb new file mode 100644 index 000000000..349afb2c5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB Cassandra table partition key + # + class CassandraPartitionKey + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table partition key + attr_accessor :name + + + # + # Mapper for CassandraPartitionKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraPartitionKey', + type: { + name: 'Composite', + class_name: 'CassandraPartitionKey', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb new file mode 100644 index 000000000..97921ec3c --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb @@ -0,0 +1,95 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB Cassandra table schema + # + class CassandraSchema + + include MsRestAzure + + # @return [Array] List of Cassandra table columns. + attr_accessor :columns + + # @return [Array] List of partition key. + attr_accessor :partition_keys + + # @return [Array] List of cluster key. + attr_accessor :cluster_keys + + + # + # Mapper for CassandraSchema class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraSchema', + type: { + name: 'Composite', + class_name: 'CassandraSchema', + model_properties: { + columns: { + client_side_validation: true, + required: false, + serialized_name: 'columns', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ColumnElementType', + type: { + name: 'Composite', + class_name: 'Column' + } + } + } + }, + partition_keys: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKeys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CassandraPartitionKeyElementType', + type: { + name: 'Composite', + class_name: 'CassandraPartitionKey' + } + } + } + }, + cluster_keys: { + client_side_validation: true, + required: false, + serialized_name: 'clusterKeys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ClusterKeyElementType', + type: { + name: 'Composite', + class_name: 'ClusterKey' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb new file mode 100644 index 000000000..8310859a1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB Cassandra table. + # + class CassandraTableCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraTableResource] The standard JSON format of a + # Cassandra table + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for CassandraTableCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'CassandraTableCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraTableResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb new file mode 100644 index 000000000..06c1db5b4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class CassandraTableGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for CassandraTableGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableGetProperties_options', + type: { + name: 'Composite', + class_name: 'CassandraTableGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb new file mode 100644 index 000000000..a513852cf --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb @@ -0,0 +1,119 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class CassandraTableGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table + attr_accessor :id + + # @return [Integer] Time to live of the Cosmos DB Cassandra table + attr_accessor :default_ttl + + # @return [CassandraSchema] Schema of the Cosmos DB Cassandra table + attr_accessor :schema + + # @return [Integer] Analytical TTL. + attr_accessor :analytical_storage_ttl + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for CassandraTableGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableGetProperties_resource', + type: { + name: 'Composite', + class_name: 'CassandraTableGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + schema: { + client_side_validation: true, + required: false, + serialized_name: 'schema', + type: { + name: 'Composite', + class_name: 'CassandraSchema' + } + }, + analytical_storage_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'analyticalStorageTtl', + type: { + name: 'Number' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb new file mode 100644 index 000000000..351d8cbf0 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB Cassandra table. + # + class CassandraTableGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [CassandraTableGetPropertiesResource] + attr_accessor :resource + + # @return [CassandraTableGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for CassandraTableGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableGetResults', + type: { + name: 'Composite', + class_name: 'CassandraTableGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'CassandraTableGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CassandraTableGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb new file mode 100644 index 000000000..529b52ee4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the Cassandra tables and their + # properties. + # + class CassandraTableListResult + + include MsRestAzure + + # @return [Array] List of Cassandra tables and + # their properties. + attr_accessor :value + + + # + # Mapper for CassandraTableListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableListResult', + type: { + name: 'Composite', + class_name: 'CassandraTableListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableGetResultsElementType', + type: { + name: 'Composite', + class_name: 'CassandraTableGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb new file mode 100644 index 000000000..a1be67c92 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb @@ -0,0 +1,80 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB Cassandra table resource object + # + class CassandraTableResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table + attr_accessor :id + + # @return [Integer] Time to live of the Cosmos DB Cassandra table + attr_accessor :default_ttl + + # @return [CassandraSchema] Schema of the Cosmos DB Cassandra table + attr_accessor :schema + + # @return [Integer] Analytical TTL. + attr_accessor :analytical_storage_ttl + + + # + # Mapper for CassandraTableResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CassandraTableResource', + type: { + name: 'Composite', + class_name: 'CassandraTableResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + schema: { + client_side_validation: true, + required: false, + serialized_name: 'schema', + type: { + name: 'Composite', + class_name: 'CassandraSchema' + } + }, + analytical_storage_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'analyticalStorageTtl', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb new file mode 100644 index 000000000..c532a8c96 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB Cassandra table cluster key + # + class ClusterKey + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table cluster key + attr_accessor :name + + # @return [String] Order of the Cosmos DB Cassandra table cluster key, + # only support "Asc" and "Desc" + attr_accessor :order_by + + + # + # Mapper for ClusterKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ClusterKey', + type: { + name: 'Composite', + class_name: 'ClusterKey', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + order_by: { + client_side_validation: true, + required: false, + serialized_name: 'orderBy', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/column.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/column.rb new file mode 100644 index 000000000..ae1135f6e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/column.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB Cassandra table column + # + class Column + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Cassandra table column + attr_accessor :name + + # @return [String] Type of the Cosmos DB Cassandra table column + attr_accessor :type + + + # + # Mapper for Column class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Column', + type: { + name: 'Composite', + class_name: 'Column', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb new file mode 100644 index 000000000..e4ffd4f56 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class CompositePath + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + # @return [CompositePathSortOrder] Sort order for composite paths. + # Possible values include: 'Ascending', 'Descending' + attr_accessor :order + + + # + # Mapper for CompositePath class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CompositePath', + type: { + name: 'Composite', + class_name: 'CompositePath', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + order: { + client_side_validation: true, + required: false, + serialized_name: 'order', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb new file mode 100644 index 000000000..924128a29 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for CompositePathSortOrder + # + module CompositePathSortOrder + Ascending = "Ascending" + Descending = "Descending" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb new file mode 100644 index 000000000..9f58ce940 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for ConflictResolutionMode + # + module ConflictResolutionMode + LastWriterWins = "LastWriterWins" + Custom = "Custom" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb new file mode 100644 index 000000000..6cd5e84ba --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The conflict resolution policy for the container. + # + class ConflictResolutionPolicy + + include MsRestAzure + + # @return [ConflictResolutionMode] Indicates the conflict resolution + # mode. Possible values include: 'LastWriterWins', 'Custom'. Default + # value: 'LastWriterWins' . + attr_accessor :mode + + # @return [String] The conflict resolution path in the case of + # LastWriterWins mode. + attr_accessor :conflict_resolution_path + + # @return [String] The procedure to resolve conflicts in the case of + # custom mode. + attr_accessor :conflict_resolution_procedure + + + # + # Mapper for ConflictResolutionPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ConflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy', + model_properties: { + mode: { + client_side_validation: true, + required: false, + serialized_name: 'mode', + default_value: 'LastWriterWins', + type: { + name: 'String' + } + }, + conflict_resolution_path: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPath', + type: { + name: 'String' + } + }, + conflict_resolution_procedure: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionProcedure', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb new file mode 100644 index 000000000..7f005ba4a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb @@ -0,0 +1,15 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for ConnectorOffer + # + module ConnectorOffer + Small = "Small" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb new file mode 100644 index 000000000..419d5fa71 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb @@ -0,0 +1,86 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The consistency policy for the Cosmos DB database account. + # + class ConsistencyPolicy + + include MsRestAzure + + # @return [DefaultConsistencyLevel] The default consistency level and + # configuration settings of the Cosmos DB account. Possible values + # include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', + # 'ConsistentPrefix' + attr_accessor :default_consistency_level + + # @return [Integer] When used with the Bounded Staleness consistency + # level, this value represents the number of stale requests tolerated. + # Accepted range for this value is 1 – 2,147,483,647. Required when + # defaultConsistencyPolicy is set to 'BoundedStaleness'. + attr_accessor :max_staleness_prefix + + # @return [Integer] When used with the Bounded Staleness consistency + # level, this value represents the time amount of staleness (in seconds) + # tolerated. Accepted range for this value is 5 - 86400. Required when + # defaultConsistencyPolicy is set to 'BoundedStaleness'. + attr_accessor :max_interval_in_seconds + + + # + # Mapper for ConsistencyPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ConsistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy', + model_properties: { + default_consistency_level: { + client_side_validation: true, + required: true, + serialized_name: 'defaultConsistencyLevel', + type: { + name: 'Enum', + module: 'DefaultConsistencyLevel' + } + }, + max_staleness_prefix: { + client_side_validation: true, + required: false, + serialized_name: 'maxStalenessPrefix', + constraints: { + InclusiveMaximum: 2147483647, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + max_interval_in_seconds: { + client_side_validation: true, + required: false, + serialized_name: 'maxIntervalInSeconds', + constraints: { + InclusiveMaximum: 86400, + InclusiveMinimum: 5 + }, + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb new file mode 100644 index 000000000..0c769cf5a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The configuration of the partition key to be used for partitioning data + # into multiple partitions + # + class ContainerPartitionKey + + include MsRestAzure + + # @return [Array] List of paths using which data within the + # container can be partitioned + attr_accessor :paths + + # @return [PartitionKind] Indicates the kind of algorithm used for + # partitioning. Possible values include: 'Hash', 'Range'. Default value: + # 'Hash' . + attr_accessor :kind + + # @return [Integer] Indicates the version of the partition key definition + attr_accessor :version + + + # + # Mapper for ContainerPartitionKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ContainerPartitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey', + model_properties: { + paths: { + client_side_validation: true, + required: false, + serialized_name: 'paths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'Hash', + type: { + name: 'String' + } + }, + version: { + client_side_validation: true, + required: false, + serialized_name: 'version', + constraints: { + InclusiveMaximum: 2, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb new file mode 100644 index 000000000..e172b62ea --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb @@ -0,0 +1,61 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # CreateUpdateOptions are a list of key-value pairs that describe the + # resource. Supported keys are "If-Match", "If-None-Match", "Session-Token" + # and "Throughput" + # + class CreateUpdateOptions + + include MsRestAzure + + # @return [Integer] Request Units per second. For example, "throughput": + # 10000. + attr_accessor :throughput + + # @return [AutoscaleSettings] Specifies the Autoscale settings. + attr_accessor :autoscale_settings + + + # + # Mapper for CreateUpdateOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CreateUpdateOptions', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/data_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/data_type.rb new file mode 100644 index 000000000..a588e7305 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/data_type.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for DataType + # + module DataType + String = "String" + Number = "Number" + Point = "Point" + Polygon = "Polygon" + LineString = "LineString" + MultiPolygon = "MultiPolygon" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb new file mode 100644 index 000000000..6032a578d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Connection string for the Cosmos DB account + # + class DatabaseAccountConnectionString + + include MsRestAzure + + # @return [String] Value of the connection string + attr_accessor :connection_string + + # @return [String] Description of the connection string + attr_accessor :description + + + # + # Mapper for DatabaseAccountConnectionString class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountConnectionString', + type: { + name: 'Composite', + class_name: 'DatabaseAccountConnectionString', + model_properties: { + connection_string: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'connectionString', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb new file mode 100644 index 000000000..611c22d1f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb @@ -0,0 +1,342 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB database accounts. + # + class DatabaseAccountCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [DatabaseAccountKind] Indicates the type of database account. + # This can only be set at database account creation. Possible values + # include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. Default value: + # 'GlobalDocumentDB' . + attr_accessor :kind + + # @return [ConsistencyPolicy] The consistency policy for the Cosmos DB + # account. + attr_accessor :consistency_policy + + # @return [Array] An array that contains the georeplication + # locations enabled for the Cosmos DB account. + attr_accessor :locations + + # @return [String] The offer type for the database. Default value: + # 'Standard' . + attr_accessor :database_account_offer_type + + # @return [Array] List of IpRules. + attr_accessor :ip_rules + + # @return [Boolean] Flag to indicate whether to enable/disable Virtual + # Network ACL rules. + attr_accessor :is_virtual_network_filter_enabled + + # @return [Boolean] Enables automatic failover of the write region in the + # rare event that the region is unavailable due to an outage. Automatic + # failover will result in a new write region for the account and is + # chosen based on the failover priorities configured for the account. + attr_accessor :enable_automatic_failover + + # @return [Array] List of Cosmos DB capabilities for the + # account + attr_accessor :capabilities + + # @return [Array] List of Virtual Network ACL rules + # configured for the Cosmos DB account. + attr_accessor :virtual_network_rules + + # @return [Boolean] Enables the account to write in multiple locations + attr_accessor :enable_multiple_write_locations + + # @return [Boolean] Enables the cassandra connector on the Cosmos DB C* + # account + attr_accessor :enable_cassandra_connector + + # @return [ConnectorOffer] The cassandra connector offer type for the + # Cosmos DB database C* account. Possible values include: 'Small' + attr_accessor :connector_offer + + # @return [Boolean] Disable write operations on metadata resources + # (databases, containers, throughput) via account keys + attr_accessor :disable_key_based_metadata_write_access + + # @return [String] The URI of the key vault + attr_accessor :key_vault_key_uri + + # @return [PublicNetworkAccess] Whether requests from Public Network are + # allowed. Possible values include: 'Enabled', 'Disabled' + attr_accessor :public_network_access + + # @return [Boolean] Flag to indicate whether Free Tier is enabled. + attr_accessor :enable_free_tier + + # @return [ApiProperties] API specific properties. Currently, supported + # only for MongoDB API. + attr_accessor :api_properties + + # @return [Boolean] Flag to indicate whether to enable storage analytics. + attr_accessor :enable_analytical_storage + + + # + # Mapper for DatabaseAccountCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'DatabaseAccountCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'GlobalDocumentDB', + type: { + name: 'String' + } + }, + consistency_policy: { + client_side_validation: true, + required: false, + serialized_name: 'properties.consistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy' + } + }, + locations: { + client_side_validation: true, + required: true, + serialized_name: 'properties.locations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + database_account_offer_type: { + client_side_validation: true, + required: true, + is_constant: true, + serialized_name: 'properties.databaseAccountOfferType', + default_value: 'Standard', + type: { + name: 'String' + } + }, + ip_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ipRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'IpAddressOrRangeElementType', + type: { + name: 'Composite', + class_name: 'IpAddressOrRange' + } + } + } + }, + is_virtual_network_filter_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isVirtualNetworkFilterEnabled', + type: { + name: 'Boolean' + } + }, + enable_automatic_failover: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAutomaticFailover', + type: { + name: 'Boolean' + } + }, + capabilities: { + client_side_validation: true, + required: false, + serialized_name: 'properties.capabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CapabilityElementType', + type: { + name: 'Composite', + class_name: 'Capability' + } + } + } + }, + virtual_network_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRuleElementType', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule' + } + } + } + }, + enable_multiple_write_locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableMultipleWriteLocations', + type: { + name: 'Boolean' + } + }, + enable_cassandra_connector: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableCassandraConnector', + type: { + name: 'Boolean' + } + }, + connector_offer: { + client_side_validation: true, + required: false, + serialized_name: 'properties.connectorOffer', + type: { + name: 'String' + } + }, + disable_key_based_metadata_write_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disableKeyBasedMetadataWriteAccess', + type: { + name: 'Boolean' + } + }, + key_vault_key_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.keyVaultKeyUri', + type: { + name: 'String' + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + type: { + name: 'String' + } + }, + enable_free_tier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableFreeTier', + type: { + name: 'Boolean' + } + }, + api_properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties.apiProperties', + type: { + name: 'Composite', + class_name: 'ApiProperties' + } + }, + enable_analytical_storage: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAnalyticalStorage', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb new file mode 100644 index 000000000..42a1c83c4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb @@ -0,0 +1,455 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB database account. + # + class DatabaseAccountGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [DatabaseAccountKind] Indicates the type of database account. + # This can only be set at database account creation. Possible values + # include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. Default value: + # 'GlobalDocumentDB' . + attr_accessor :kind + + # @return [String] + attr_accessor :provisioning_state + + # @return [String] The connection endpoint for the Cosmos DB database + # account. + attr_accessor :document_endpoint + + # @return [DatabaseAccountOfferType] The offer type for the Cosmos DB + # database account. Default value: Standard. Possible values include: + # 'Standard' + attr_accessor :database_account_offer_type + + # @return [Array] List of IpRules. + attr_accessor :ip_rules + + # @return [Boolean] Flag to indicate whether to enable/disable Virtual + # Network ACL rules. + attr_accessor :is_virtual_network_filter_enabled + + # @return [Boolean] Enables automatic failover of the write region in the + # rare event that the region is unavailable due to an outage. Automatic + # failover will result in a new write region for the account and is + # chosen based on the failover priorities configured for the account. + attr_accessor :enable_automatic_failover + + # @return [ConsistencyPolicy] The consistency policy for the Cosmos DB + # database account. + attr_accessor :consistency_policy + + # @return [Array] List of Cosmos DB capabilities for the + # account + attr_accessor :capabilities + + # @return [Array] An array that contains the write location for + # the Cosmos DB account. + attr_accessor :write_locations + + # @return [Array] An array that contains of the read locations + # enabled for the Cosmos DB account. + attr_accessor :read_locations + + # @return [Array] An array that contains all of the locations + # enabled for the Cosmos DB account. + attr_accessor :locations + + # @return [Array] An array that contains the regions + # ordered by their failover priorities. + attr_accessor :failover_policies + + # @return [Array] List of Virtual Network ACL rules + # configured for the Cosmos DB account. + attr_accessor :virtual_network_rules + + # @return [Array] List of Private Endpoint + # Connections configured for the Cosmos DB account. + attr_accessor :private_endpoint_connections + + # @return [Boolean] Enables the account to write in multiple locations + attr_accessor :enable_multiple_write_locations + + # @return [Boolean] Enables the cassandra connector on the Cosmos DB C* + # account + attr_accessor :enable_cassandra_connector + + # @return [ConnectorOffer] The cassandra connector offer type for the + # Cosmos DB database C* account. Possible values include: 'Small' + attr_accessor :connector_offer + + # @return [Boolean] Disable write operations on metadata resources + # (databases, containers, throughput) via account keys + attr_accessor :disable_key_based_metadata_write_access + + # @return [String] The URI of the key vault + attr_accessor :key_vault_key_uri + + # @return [PublicNetworkAccess] Whether requests from Public Network are + # allowed. Possible values include: 'Enabled', 'Disabled' + attr_accessor :public_network_access + + # @return [Boolean] Flag to indicate whether Free Tier is enabled. + attr_accessor :enable_free_tier + + # @return [ApiProperties] API specific properties. + attr_accessor :api_properties + + # @return [Boolean] Flag to indicate whether to enable storage analytics. + attr_accessor :enable_analytical_storage + + + # + # Mapper for DatabaseAccountGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountGetResults', + type: { + name: 'Composite', + class_name: 'DatabaseAccountGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'GlobalDocumentDB', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + document_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.documentEndpoint', + type: { + name: 'String' + } + }, + database_account_offer_type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.databaseAccountOfferType', + type: { + name: 'Enum', + module: 'DatabaseAccountOfferType' + } + }, + ip_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ipRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'IpAddressOrRangeElementType', + type: { + name: 'Composite', + class_name: 'IpAddressOrRange' + } + } + } + }, + is_virtual_network_filter_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isVirtualNetworkFilterEnabled', + type: { + name: 'Boolean' + } + }, + enable_automatic_failover: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAutomaticFailover', + type: { + name: 'Boolean' + } + }, + consistency_policy: { + client_side_validation: true, + required: false, + serialized_name: 'properties.consistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy' + } + }, + capabilities: { + client_side_validation: true, + required: false, + serialized_name: 'properties.capabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CapabilityElementType', + type: { + name: 'Composite', + class_name: 'Capability' + } + } + } + }, + write_locations: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.writeLocations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + read_locations: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.readLocations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + locations: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.locations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + failover_policies: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.failoverPolicies', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicyElementType', + type: { + name: 'Composite', + class_name: 'FailoverPolicy' + } + } + } + }, + virtual_network_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRuleElementType', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule' + } + } + } + }, + private_endpoint_connections: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.privateEndpointConnections', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnectionElementType', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection' + } + } + } + }, + enable_multiple_write_locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableMultipleWriteLocations', + type: { + name: 'Boolean' + } + }, + enable_cassandra_connector: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableCassandraConnector', + type: { + name: 'Boolean' + } + }, + connector_offer: { + client_side_validation: true, + required: false, + serialized_name: 'properties.connectorOffer', + type: { + name: 'String' + } + }, + disable_key_based_metadata_write_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disableKeyBasedMetadataWriteAccess', + type: { + name: 'Boolean' + } + }, + key_vault_key_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.keyVaultKeyUri', + type: { + name: 'String' + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + type: { + name: 'String' + } + }, + enable_free_tier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableFreeTier', + type: { + name: 'Boolean' + } + }, + api_properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties.apiProperties', + type: { + name: 'Composite', + class_name: 'ApiProperties' + } + }, + enable_analytical_storage: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAnalyticalStorage', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb new file mode 100644 index 000000000..df6c504f3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for DatabaseAccountKind + # + module DatabaseAccountKind + GlobalDocumentDB = "GlobalDocumentDB" + MongoDB = "MongoDB" + Parse = "Parse" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb new file mode 100644 index 000000000..bd5db8ae9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The connection strings for the given database account. + # + class DatabaseAccountListConnectionStringsResult + + include MsRestAzure + + # @return [Array] An array that contains + # the connection strings for the Cosmos DB account. + attr_accessor :connection_strings + + + # + # Mapper for DatabaseAccountListConnectionStringsResult class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountListConnectionStringsResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountListConnectionStringsResult', + model_properties: { + connection_strings: { + client_side_validation: true, + required: false, + serialized_name: 'connectionStrings', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountConnectionStringElementType', + type: { + name: 'Composite', + class_name: 'DatabaseAccountConnectionString' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb new file mode 100644 index 000000000..ce95ef60d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The access keys for the given database account. + # + class DatabaseAccountListKeysResult < DatabaseAccountListReadOnlyKeysResult + + include MsRestAzure + + # @return [String] Base 64 encoded value of the primary read-write key. + attr_accessor :primary_master_key + + # @return [String] Base 64 encoded value of the secondary read-write key. + attr_accessor :secondary_master_key + + + # + # Mapper for DatabaseAccountListKeysResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountListKeysResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountListKeysResult', + model_properties: { + primary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryReadonlyMasterKey', + type: { + name: 'String' + } + }, + secondary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'secondaryReadonlyMasterKey', + type: { + name: 'String' + } + }, + primary_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryMasterKey', + type: { + name: 'String' + } + }, + secondary_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'secondaryMasterKey', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb new file mode 100644 index 000000000..8efb58155 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The read-only access keys for the given database account. + # + class DatabaseAccountListReadOnlyKeysResult + + include MsRestAzure + + # @return [String] Base 64 encoded value of the primary read-only key. + attr_accessor :primary_readonly_master_key + + # @return [String] Base 64 encoded value of the secondary read-only key. + attr_accessor :secondary_readonly_master_key + + + # + # Mapper for DatabaseAccountListReadOnlyKeysResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountListReadOnlyKeysResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountListReadOnlyKeysResult', + model_properties: { + primary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryReadonlyMasterKey', + type: { + name: 'String' + } + }, + secondary_readonly_master_key: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'secondaryReadonlyMasterKey', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb new file mode 100644 index 000000000..98eecd295 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb @@ -0,0 +1,15 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for DatabaseAccountOfferType + # + module DatabaseAccountOfferType + Standard = "Standard" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb new file mode 100644 index 000000000..0edd55786 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to regenerate the keys within the database account. + # + class DatabaseAccountRegenerateKeyParameters + + include MsRestAzure + + # @return [KeyKind] The access key to regenerate. Possible values + # include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + attr_accessor :key_kind + + + # + # Mapper for DatabaseAccountRegenerateKeyParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountRegenerateKeyParameters', + type: { + name: 'Composite', + class_name: 'DatabaseAccountRegenerateKeyParameters', + model_properties: { + key_kind: { + client_side_validation: true, + required: true, + serialized_name: 'keyKind', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb new file mode 100644 index 000000000..bedb53833 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb @@ -0,0 +1,293 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters for patching Azure Cosmos DB database account properties. + # + class DatabaseAccountUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] + attr_accessor :tags + + # @return [String] The location of the resource group to which the + # resource belongs. + attr_accessor :location + + # @return [ConsistencyPolicy] The consistency policy for the Cosmos DB + # account. + attr_accessor :consistency_policy + + # @return [Array] An array that contains the georeplication + # locations enabled for the Cosmos DB account. + attr_accessor :locations + + # @return [Array] List of IpRules. + attr_accessor :ip_rules + + # @return [Boolean] Flag to indicate whether to enable/disable Virtual + # Network ACL rules. + attr_accessor :is_virtual_network_filter_enabled + + # @return [Boolean] Enables automatic failover of the write region in the + # rare event that the region is unavailable due to an outage. Automatic + # failover will result in a new write region for the account and is + # chosen based on the failover priorities configured for the account. + attr_accessor :enable_automatic_failover + + # @return [Array] List of Cosmos DB capabilities for the + # account + attr_accessor :capabilities + + # @return [Array] List of Virtual Network ACL rules + # configured for the Cosmos DB account. + attr_accessor :virtual_network_rules + + # @return [Boolean] Enables the account to write in multiple locations + attr_accessor :enable_multiple_write_locations + + # @return [Boolean] Enables the cassandra connector on the Cosmos DB C* + # account + attr_accessor :enable_cassandra_connector + + # @return [ConnectorOffer] The cassandra connector offer type for the + # Cosmos DB database C* account. Possible values include: 'Small' + attr_accessor :connector_offer + + # @return [Boolean] Disable write operations on metadata resources + # (databases, containers, throughput) via account keys + attr_accessor :disable_key_based_metadata_write_access + + # @return [String] The URI of the key vault + attr_accessor :key_vault_key_uri + + # @return [PublicNetworkAccess] Whether requests from Public Network are + # allowed. Possible values include: 'Enabled', 'Disabled' + attr_accessor :public_network_access + + # @return [Boolean] Flag to indicate whether Free Tier is enabled. + attr_accessor :enable_free_tier + + # @return [ApiProperties] API specific properties. Currently, supported + # only for MongoDB API. + attr_accessor :api_properties + + # @return [Boolean] Flag to indicate whether to enable storage analytics. + attr_accessor :enable_analytical_storage + + + # + # Mapper for DatabaseAccountUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountUpdateParameters', + type: { + name: 'Composite', + class_name: 'DatabaseAccountUpdateParameters', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + consistency_policy: { + client_side_validation: true, + required: false, + serialized_name: 'properties.consistencyPolicy', + type: { + name: 'Composite', + class_name: 'ConsistencyPolicy' + } + }, + locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.locations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LocationElementType', + type: { + name: 'Composite', + class_name: 'Location' + } + } + } + }, + ip_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ipRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'IpAddressOrRangeElementType', + type: { + name: 'Composite', + class_name: 'IpAddressOrRange' + } + } + } + }, + is_virtual_network_filter_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isVirtualNetworkFilterEnabled', + type: { + name: 'Boolean' + } + }, + enable_automatic_failover: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAutomaticFailover', + type: { + name: 'Boolean' + } + }, + capabilities: { + client_side_validation: true, + required: false, + serialized_name: 'properties.capabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CapabilityElementType', + type: { + name: 'Composite', + class_name: 'Capability' + } + } + } + }, + virtual_network_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRuleElementType', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule' + } + } + } + }, + enable_multiple_write_locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableMultipleWriteLocations', + type: { + name: 'Boolean' + } + }, + enable_cassandra_connector: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableCassandraConnector', + type: { + name: 'Boolean' + } + }, + connector_offer: { + client_side_validation: true, + required: false, + serialized_name: 'properties.connectorOffer', + type: { + name: 'String' + } + }, + disable_key_based_metadata_write_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disableKeyBasedMetadataWriteAccess', + type: { + name: 'Boolean' + } + }, + key_vault_key_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.keyVaultKeyUri', + type: { + name: 'String' + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + type: { + name: 'String' + } + }, + enable_free_tier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableFreeTier', + type: { + name: 'Boolean' + } + }, + api_properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties.apiProperties', + type: { + name: 'Composite', + class_name: 'ApiProperties' + } + }, + enable_analytical_storage: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enableAnalyticalStorage', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb new file mode 100644 index 000000000..5505783ff --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the database accounts and + # their properties. + # + class DatabaseAccountsListResult + + include MsRestAzure + + # @return [Array] List of database account and + # their properties. + attr_accessor :value + + + # + # Mapper for DatabaseAccountsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountsListResult', + type: { + name: 'Composite', + class_name: 'DatabaseAccountsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DatabaseAccountGetResultsElementType', + type: { + name: 'Composite', + class_name: 'DatabaseAccountGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb new file mode 100644 index 000000000..fa957c1d3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for DefaultConsistencyLevel + # + module DefaultConsistencyLevel + Eventual = "Eventual" + Session = "Session" + BoundedStaleness = "BoundedStaleness" + Strong = "Strong" + ConsistentPrefix = "ConsistentPrefix" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/error_response.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/error_response.rb new file mode 100644 index 000000000..be20f4ff6 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/error_response.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Error Response. + # + class ErrorResponse + + include MsRestAzure + + # @return [String] Error code. + attr_accessor :code + + # @return [String] Error message indicating why the operation failed. + attr_accessor :message + + + # + # Mapper for ErrorResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ErrorResponse', + type: { + name: 'Composite', + class_name: 'ErrorResponse', + model_properties: { + code: { + client_side_validation: true, + required: false, + serialized_name: 'code', + type: { + name: 'String' + } + }, + message: { + client_side_validation: true, + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb new file mode 100644 index 000000000..af34cf87f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class ExcludedPath + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + + # + # Mapper for ExcludedPath class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExcludedPath', + type: { + name: 'Composite', + class_name: 'ExcludedPath', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb new file mode 100644 index 000000000..ec37b1cd6 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb @@ -0,0 +1,74 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The system generated resource properties associated with SQL databases, + # SQL containers, Gremlin databases and Gremlin graphs. + # + class ExtendedResourceProperties + + include MsRestAzure + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for ExtendedResourceProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExtendedResourceProperties', + type: { + name: 'Composite', + class_name: 'ExtendedResourceProperties', + model_properties: { + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb new file mode 100644 index 000000000..22aadd7a7 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The list of new failover policies for the failover priority change. + # + class FailoverPolicies + + include MsRestAzure + + # @return [Array] List of failover policies. + attr_accessor :failover_policies + + + # + # Mapper for FailoverPolicies class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicies', + type: { + name: 'Composite', + class_name: 'FailoverPolicies', + model_properties: { + failover_policies: { + client_side_validation: true, + required: true, + serialized_name: 'failoverPolicies', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicyElementType', + type: { + name: 'Composite', + class_name: 'FailoverPolicy' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb new file mode 100644 index 000000000..86ec9e58f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The failover policy for a given region of a database account. + # + class FailoverPolicy + + include MsRestAzure + + # @return [String] The unique identifier of the region in which the + # database account replicates to. Example: + # <accountName>-<locationName>. + attr_accessor :id + + # @return [String] The name of the region in which the database account + # exists. + attr_accessor :location_name + + # @return [Integer] The failover priority of the region. A failover + # priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority + # values must be unique for each of the regions in which the database + # account exists. + attr_accessor :failover_priority + + + # + # Mapper for FailoverPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'FailoverPolicy', + type: { + name: 'Composite', + class_name: 'FailoverPolicy', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + location_name: { + client_side_validation: true, + required: false, + serialized_name: 'locationName', + type: { + name: 'String' + } + }, + failover_priority: { + client_side_validation: true, + required: false, + serialized_name: 'failoverPriority', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb new file mode 100644 index 000000000..b6ce9c3b5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB Gremlin database. + # + class GremlinDatabaseCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinDatabaseResource] The standard JSON format of a Gremlin + # database + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for GremlinDatabaseCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb new file mode 100644 index 000000000..444b77f54 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class GremlinDatabaseGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for GremlinDatabaseGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseGetProperties_options', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb new file mode 100644 index 000000000..3bec75f08 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class GremlinDatabaseGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin database + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for GremlinDatabaseGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseGetProperties_resource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb new file mode 100644 index 000000000..8f62e2ebb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB Gremlin database. + # + class GremlinDatabaseGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinDatabaseGetPropertiesResource] + attr_accessor :resource + + # @return [GremlinDatabaseGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for GremlinDatabaseGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseGetResults', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb new file mode 100644 index 000000000..3d85513c6 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the Gremlin databases and + # their properties. + # + class GremlinDatabaseListResult + + include MsRestAzure + + # @return [Array] List of Gremlin databases + # and their properties. + attr_accessor :value + + + # + # Mapper for GremlinDatabaseListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseListResult', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseGetResultsElementType', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb new file mode 100644 index 000000000..276bd8a08 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB Gremlin database resource object + # + class GremlinDatabaseResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin database + attr_accessor :id + + + # + # Mapper for GremlinDatabaseResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinDatabaseResource', + type: { + name: 'Composite', + class_name: 'GremlinDatabaseResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb new file mode 100644 index 000000000..3e2fdeb7e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB Gremlin graph. + # + class GremlinGraphCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinGraphResource] The standard JSON format of a Gremlin + # graph + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for GremlinGraphCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'GremlinGraphCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinGraphResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb new file mode 100644 index 000000000..353156a65 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class GremlinGraphGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for GremlinGraphGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphGetProperties_options', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb new file mode 100644 index 000000000..605d63d6b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb @@ -0,0 +1,150 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class GremlinGraphGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin graph + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # graph + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the graph. + attr_accessor :conflict_resolution_policy + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for GremlinGraphGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphGetProperties_resource', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb new file mode 100644 index 000000000..afc61941b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB Gremlin graph. + # + class GremlinGraphGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [GremlinGraphGetPropertiesResource] + attr_accessor :resource + + # @return [GremlinGraphGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for GremlinGraphGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphGetResults', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb new file mode 100644 index 000000000..d26e49195 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the graphs and their + # properties. + # + class GremlinGraphListResult + + include MsRestAzure + + # @return [Array] List of graphs and their + # properties. + attr_accessor :value + + + # + # Mapper for GremlinGraphListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphListResult', + type: { + name: 'Composite', + class_name: 'GremlinGraphListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphGetResultsElementType', + type: { + name: 'Composite', + class_name: 'GremlinGraphGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb new file mode 100644 index 000000000..6d5bf046b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB Gremlin graph resource object + # + class GremlinGraphResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB Gremlin graph + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # graph + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the graph. + attr_accessor :conflict_resolution_policy + + + # + # Mapper for GremlinGraphResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GremlinGraphResource', + type: { + name: 'Composite', + class_name: 'GremlinGraphResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/included_path.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/included_path.rb new file mode 100644 index 000000000..7cfda5845 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/included_path.rb @@ -0,0 +1,67 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The paths that are included in indexing + # + class IncludedPath + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + # @return [Array] List of indexes for this path + attr_accessor :indexes + + + # + # Mapper for IncludedPath class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'IncludedPath', + type: { + name: 'Composite', + class_name: 'IncludedPath', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + indexes: { + client_side_validation: true, + required: false, + serialized_name: 'indexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'IndexesElementType', + type: { + name: 'Composite', + class_name: 'Indexes' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb new file mode 100644 index 000000000..ca7a63275 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for IndexKind + # + module IndexKind + Hash = "Hash" + Range = "Range" + Spatial = "Spatial" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexes.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexes.rb new file mode 100644 index 000000000..320752c71 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexes.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The indexes for the path. + # + class Indexes + + include MsRestAzure + + # @return [DataType] The datatype for which the indexing behavior is + # applied to. Possible values include: 'String', 'Number', 'Point', + # 'Polygon', 'LineString', 'MultiPolygon'. Default value: 'String' . + attr_accessor :data_type + + # @return [Integer] The precision of the index. -1 is maximum precision. + attr_accessor :precision + + # @return [IndexKind] Indicates the type of index. Possible values + # include: 'Hash', 'Range', 'Spatial'. Default value: 'Hash' . + attr_accessor :kind + + + # + # Mapper for Indexes class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Indexes', + type: { + name: 'Composite', + class_name: 'Indexes', + model_properties: { + data_type: { + client_side_validation: true, + required: false, + serialized_name: 'dataType', + default_value: 'String', + type: { + name: 'String' + } + }, + precision: { + client_side_validation: true, + required: false, + serialized_name: 'precision', + type: { + name: 'Number' + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + default_value: 'Hash', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb new file mode 100644 index 000000000..61f70198e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for IndexingMode + # + module IndexingMode + Consistent = "Consistent" + Lazy = "Lazy" + None = "None" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb new file mode 100644 index 000000000..357e770eb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb @@ -0,0 +1,147 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB indexing policy + # + class IndexingPolicy + + include MsRestAzure + + # @return [Boolean] Indicates if the indexing policy is automatic + attr_accessor :automatic + + # @return [IndexingMode] Indicates the indexing mode. Possible values + # include: 'Consistent', 'Lazy', 'None'. Default value: 'Consistent' . + attr_accessor :indexing_mode + + # @return [Array] List of paths to include in the indexing + attr_accessor :included_paths + + # @return [Array] List of paths to exclude from indexing + attr_accessor :excluded_paths + + # @return [Array>] List of composite path list + attr_accessor :composite_indexes + + # @return [Array] List of spatial specifics + attr_accessor :spatial_indexes + + + # + # Mapper for IndexingPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'IndexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy', + model_properties: { + automatic: { + client_side_validation: true, + required: false, + serialized_name: 'automatic', + type: { + name: 'Boolean' + } + }, + indexing_mode: { + client_side_validation: true, + required: false, + serialized_name: 'indexingMode', + default_value: 'Consistent', + type: { + name: 'String' + } + }, + included_paths: { + client_side_validation: true, + required: false, + serialized_name: 'includedPaths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'IncludedPathElementType', + type: { + name: 'Composite', + class_name: 'IncludedPath' + } + } + } + }, + excluded_paths: { + client_side_validation: true, + required: false, + serialized_name: 'excludedPaths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ExcludedPathElementType', + type: { + name: 'Composite', + class_name: 'ExcludedPath' + } + } + } + }, + composite_indexes: { + client_side_validation: true, + required: false, + serialized_name: 'compositeIndexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CompositePathElementType', + type: { + name: 'Composite', + class_name: 'CompositePath' + } + } + } + } + } + }, + spatial_indexes: { + client_side_validation: true, + required: false, + serialized_name: 'spatialIndexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SpatialSpecElementType', + type: { + name: 'Composite', + class_name: 'SpatialSpec' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb new file mode 100644 index 000000000..32e6ed0ab --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb @@ -0,0 +1,51 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # IpAddressOrRange object + # + class IpAddressOrRange + + include MsRestAzure + + # @return [String] A single IPv4 address or a single IPv4 address range + # in CIDR format. Provided IPs must be well-formatted and cannot be + # contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, + # 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by the + # IP address filter. Example of valid inputs: “23.40.210.245” or + # “23.40.210.0/8”. + attr_accessor :ip_address_or_range + + + # + # Mapper for IpAddressOrRange class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'IpAddressOrRange', + type: { + name: 'Composite', + class_name: 'IpAddressOrRange', + model_properties: { + ip_address_or_range: { + client_side_validation: true, + required: false, + serialized_name: 'ipAddressOrRange', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb new file mode 100644 index 000000000..1df78ec94 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for KeyKind + # + module KeyKind + Primary = "primary" + Secondary = "secondary" + PrimaryReadonly = "primaryReadonly" + SecondaryReadonly = "secondaryReadonly" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/location.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/location.rb new file mode 100644 index 000000000..e06eda32b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/location.rb @@ -0,0 +1,114 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # A region in which the Azure Cosmos DB database account is deployed. + # + class Location + + include MsRestAzure + + # @return [String] The unique identifier of the region within the + # database account. Example: <accountName>-<locationName>. + attr_accessor :id + + # @return [String] The name of the region. + attr_accessor :location_name + + # @return [String] The connection endpoint for the specific region. + # Example: + # https://<accountName>-<locationName>.documents.azure.com:443/ + attr_accessor :document_endpoint + + # @return [String] + attr_accessor :provisioning_state + + # @return [Integer] The failover priority of the region. A failover + # priority of 0 indicates a write region. The maximum value for a + # failover priority = (total number of regions - 1). Failover priority + # values must be unique for each of the regions in which the database + # account exists. + attr_accessor :failover_priority + + # @return [Boolean] Flag to indicate whether or not this region is an + # AvailabilityZone region + attr_accessor :is_zone_redundant + + + # + # Mapper for Location class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Location', + type: { + name: 'Composite', + class_name: 'Location', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + location_name: { + client_side_validation: true, + required: false, + serialized_name: 'locationName', + type: { + name: 'String' + } + }, + document_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'documentEndpoint', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'provisioningState', + type: { + name: 'String' + } + }, + failover_priority: { + client_side_validation: true, + required: false, + serialized_name: 'failoverPriority', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, + is_zone_redundant: { + client_side_validation: true, + required: false, + serialized_name: 'isZoneRedundant', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric.rb new file mode 100644 index 000000000..beded0089 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric.rb @@ -0,0 +1,120 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Metric data + # + class Metric + + include MsRestAzure + + # @return [DateTime] The start time for the metric (ISO-8601 format). + attr_accessor :start_time + + # @return [DateTime] The end time for the metric (ISO-8601 format). + attr_accessor :end_time + + # @return [String] The time grain to be used to summarize the metric + # values. + attr_accessor :time_grain + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + # @return [Array] The metric values for the specified time + # window and timestep. + attr_accessor :metric_values + + + # + # Mapper for Metric class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Metric', + type: { + name: 'Composite', + class_name: 'Metric', + model_properties: { + start_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + end_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'endTime', + type: { + name: 'DateTime' + } + }, + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + metric_values: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricValues', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricValueElementType', + type: { + name: 'Composite', + class_name: 'MetricValue' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb new file mode 100644 index 000000000..9d30f1d58 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The availability of the metric. + # + class MetricAvailability + + include MsRestAzure + + # @return [String] The time grain to be used to summarize the metric + # values. + attr_accessor :time_grain + + # @return [String] The retention for the metric values. + attr_accessor :retention + + + # + # Mapper for MetricAvailability class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricAvailability', + type: { + name: 'Composite', + class_name: 'MetricAvailability', + model_properties: { + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + retention: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'retention', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb new file mode 100644 index 000000000..ce684e138 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb @@ -0,0 +1,109 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The definition of a metric. + # + class MetricDefinition + + include MsRestAzure + + # @return [Array] The list of metric availabilities + # for the account. + attr_accessor :metric_availabilities + + # @return [PrimaryAggregationType] The primary aggregation type of the + # metric. Possible values include: 'None', 'Average', 'Total', 'Minimum', + # 'Maximum', 'Last' + attr_accessor :primary_aggregation_type + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [String] The resource uri of the database. + attr_accessor :resource_uri + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + + # + # Mapper for MetricDefinition class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricDefinition', + type: { + name: 'Composite', + class_name: 'MetricDefinition', + model_properties: { + metric_availabilities: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricAvailabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricAvailabilityElementType', + type: { + name: 'Composite', + class_name: 'MetricAvailability' + } + } + } + }, + primary_aggregation_type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'primaryAggregationType', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + resource_uri: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'resourceUri', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb new file mode 100644 index 000000000..893759f1b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The response to a list metric definitions request. + # + class MetricDefinitionsListResult + + include MsRestAzure + + # @return [Array] The list of metric definitions for + # the account. + attr_accessor :value + + + # + # Mapper for MetricDefinitionsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricDefinitionsListResult', + type: { + name: 'Composite', + class_name: 'MetricDefinitionsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricDefinitionElementType', + type: { + name: 'Composite', + class_name: 'MetricDefinition' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb new file mode 100644 index 000000000..af06f7e9c --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The response to a list metrics request. + # + class MetricListResult + + include MsRestAzure + + # @return [Array] The list of metrics for the account. + attr_accessor :value + + + # + # Mapper for MetricListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricListResult', + type: { + name: 'Composite', + class_name: 'MetricListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricElementType', + type: { + name: 'Composite', + class_name: 'Metric' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb new file mode 100644 index 000000000..a76580860 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # A metric name. + # + class MetricName + + include MsRestAzure + + # @return [String] The name of the metric. + attr_accessor :value + + # @return [String] The friendly name of the metric. + attr_accessor :localized_value + + + # + # Mapper for MetricName class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricName', + type: { + name: 'Composite', + class_name: 'MetricName', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'String' + } + }, + localized_value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'localizedValue', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb new file mode 100644 index 000000000..1636f91e4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb @@ -0,0 +1,107 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Represents metrics values. + # + class MetricValue + + include MsRestAzure + + # @return [Float] The number of values for the metric. + attr_accessor :_count + + # @return [Float] The average value of the metric. + attr_accessor :average + + # @return [Float] The max value of the metric. + attr_accessor :maximum + + # @return [Float] The min value of the metric. + attr_accessor :minimum + + # @return [DateTime] The metric timestamp (ISO-8601 format). + attr_accessor :timestamp + + # @return [Float] The total value of the metric. + attr_accessor :total + + + # + # Mapper for MetricValue class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MetricValue', + type: { + name: 'Composite', + class_name: 'MetricValue', + model_properties: { + _count: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_count', + type: { + name: 'Double' + } + }, + average: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'average', + type: { + name: 'Double' + } + }, + maximum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'maximum', + type: { + name: 'Double' + } + }, + minimum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimum', + type: { + name: 'Double' + } + }, + timestamp: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timestamp', + type: { + name: 'DateTime' + } + }, + total: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'total', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb new file mode 100644 index 000000000..c538111dd --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB MongoDB collection. + # + class MongoDBCollectionCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBCollectionResource] The standard JSON format of a + # MongoDB collection + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for MongoDBCollectionCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb new file mode 100644 index 000000000..1c5c7d19a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class MongoDBCollectionGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for MongoDBCollectionGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionGetProperties_options', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb new file mode 100644 index 000000000..c6545d01e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb @@ -0,0 +1,136 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class MongoDBCollectionGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB collection + attr_accessor :id + + # @return [Hash{String => String}] A key-value pair of shard keys to be + # applied for the request. + attr_accessor :shard_key + + # @return [Array] List of index keys + attr_accessor :indexes + + # @return [Integer] Analytical TTL. + attr_accessor :analytical_storage_ttl + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for MongoDBCollectionGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionGetProperties_resource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + shard_key: { + client_side_validation: true, + required: false, + serialized_name: 'shardKey', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + indexes: { + client_side_validation: true, + required: false, + serialized_name: 'indexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexElementType', + type: { + name: 'Composite', + class_name: 'MongoIndex' + } + } + } + }, + analytical_storage_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'analyticalStorageTtl', + type: { + name: 'Number' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb new file mode 100644 index 000000000..d5a5bb903 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB MongoDB collection. + # + class MongoDBCollectionGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBCollectionGetPropertiesResource] + attr_accessor :resource + + # @return [MongoDBCollectionGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for MongoDBCollectionGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionGetResults', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb new file mode 100644 index 000000000..89f34ff9f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the MongoDB collections and + # their properties. + # + class MongoDBCollectionListResult + + include MsRestAzure + + # @return [Array] List of MongoDB + # collections and their properties. + attr_accessor :value + + + # + # Mapper for MongoDBCollectionListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionListResult', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionGetResultsElementType', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb new file mode 100644 index 000000000..37552523b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB MongoDB collection resource object + # + class MongoDBCollectionResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB collection + attr_accessor :id + + # @return [Hash{String => String}] A key-value pair of shard keys to be + # applied for the request. + attr_accessor :shard_key + + # @return [Array] List of index keys + attr_accessor :indexes + + # @return [Integer] Analytical TTL. + attr_accessor :analytical_storage_ttl + + + # + # Mapper for MongoDBCollectionResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBCollectionResource', + type: { + name: 'Composite', + class_name: 'MongoDBCollectionResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + shard_key: { + client_side_validation: true, + required: false, + serialized_name: 'shardKey', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + indexes: { + client_side_validation: true, + required: false, + serialized_name: 'indexes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexElementType', + type: { + name: 'Composite', + class_name: 'MongoIndex' + } + } + } + }, + analytical_storage_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'analyticalStorageTtl', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb new file mode 100644 index 000000000..63ead9a8b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB MongoDB database. + # + class MongoDBDatabaseCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBDatabaseResource] The standard JSON format of a MongoDB + # database + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for MongoDBDatabaseCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb new file mode 100644 index 000000000..cf19cb0d1 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class MongoDBDatabaseGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for MongoDBDatabaseGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseGetProperties_options', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb new file mode 100644 index 000000000..c7b6ca44a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class MongoDBDatabaseGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB database + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for MongoDBDatabaseGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseGetProperties_resource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb new file mode 100644 index 000000000..cad929f87 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB MongoDB database. + # + class MongoDBDatabaseGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [MongoDBDatabaseGetPropertiesResource] + attr_accessor :resource + + # @return [MongoDBDatabaseGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for MongoDBDatabaseGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseGetResults', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb new file mode 100644 index 000000000..d85ba4223 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the MongoDB databases and + # their properties. + # + class MongoDBDatabaseListResult + + include MsRestAzure + + # @return [Array] List of MongoDB databases + # and their properties. + attr_accessor :value + + + # + # Mapper for MongoDBDatabaseListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseListResult', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseGetResultsElementType', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb new file mode 100644 index 000000000..e9551fc3e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB MongoDB database resource object + # + class MongoDBDatabaseResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB MongoDB database + attr_accessor :id + + + # + # Mapper for MongoDBDatabaseResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoDBDatabaseResource', + type: { + name: 'Composite', + class_name: 'MongoDBDatabaseResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb new file mode 100644 index 000000000..9d540a5df --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB MongoDB collection index key + # + class MongoIndex + + include MsRestAzure + + # @return [MongoIndexKeys] Cosmos DB MongoDB collection index keys + attr_accessor :key + + # @return [MongoIndexOptions] Cosmos DB MongoDB collection index key + # options + attr_accessor :options + + + # + # Mapper for MongoIndex class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndex', + type: { + name: 'Composite', + class_name: 'MongoIndex', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'Composite', + class_name: 'MongoIndexKeys' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'options', + type: { + name: 'Composite', + class_name: 'MongoIndexOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb new file mode 100644 index 000000000..194e30045 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB MongoDB collection resource object + # + class MongoIndexKeys + + include MsRestAzure + + # @return [Array] List of keys for each MongoDB collection in the + # Azure Cosmos DB service + attr_accessor :keys + + + # + # Mapper for MongoIndexKeys class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexKeys', + type: { + name: 'Composite', + class_name: 'MongoIndexKeys', + model_properties: { + keys: { + client_side_validation: true, + required: false, + serialized_name: 'keys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb new file mode 100644 index 000000000..7bf55a556 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB MongoDB collection index options + # + class MongoIndexOptions + + include MsRestAzure + + # @return [Integer] Expire after seconds + attr_accessor :expire_after_seconds + + # @return [Boolean] Is unique or not + attr_accessor :unique + + + # + # Mapper for MongoIndexOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'MongoIndexOptions', + type: { + name: 'Composite', + class_name: 'MongoIndexOptions', + model_properties: { + expire_after_seconds: { + client_side_validation: true, + required: false, + serialized_name: 'expireAfterSeconds', + type: { + name: 'Number' + } + }, + unique: { + client_side_validation: true, + required: false, + serialized_name: 'unique', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb new file mode 100644 index 000000000..ed87de443 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb @@ -0,0 +1,87 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # A notebook workspace resource + # + class NotebookWorkspace < ARMProxyResource + + include MsRestAzure + + # @return [String] Specifies the endpoint of Notebook server. + attr_accessor :notebook_server_endpoint + + # @return [String] Status of the notebook workspace. Possible values are: + # Creating, Online, Deleting, Failed, Updating. + attr_accessor :status + + + # + # Mapper for NotebookWorkspace class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspace', + type: { + name: 'Composite', + class_name: 'NotebookWorkspace', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + notebook_server_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.notebookServerEndpoint', + type: { + name: 'String' + } + }, + status: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.status', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb new file mode 100644 index 000000000..539898035 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The connection info for the given notebook workspace + # + class NotebookWorkspaceConnectionInfoResult + + include MsRestAzure + + # @return [String] Specifies auth token used for connecting to Notebook + # server (uses token-based auth). + attr_accessor :auth_token + + # @return [String] Specifies the endpoint of Notebook server. + attr_accessor :notebook_server_endpoint + + + # + # Mapper for NotebookWorkspaceConnectionInfoResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceConnectionInfoResult', + type: { + name: 'Composite', + class_name: 'NotebookWorkspaceConnectionInfoResult', + model_properties: { + auth_token: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'authToken', + type: { + name: 'String' + } + }, + notebook_server_endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'notebookServerEndpoint', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb new file mode 100644 index 000000000..e7e03f695 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb @@ -0,0 +1,62 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create a notebook workspace resource + # + class NotebookWorkspaceCreateUpdateParameters < ARMProxyResource + + include MsRestAzure + + + # + # Mapper for NotebookWorkspaceCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'NotebookWorkspaceCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb new file mode 100644 index 000000000..585f9201e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # A list of notebook workspace resources + # + class NotebookWorkspaceListResult + + include MsRestAzure + + # @return [Array] Array of notebook workspace + # resources + attr_accessor :value + + + # + # Mapper for NotebookWorkspaceListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceListResult', + type: { + name: 'Composite', + class_name: 'NotebookWorkspaceListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'NotebookWorkspaceElementType', + type: { + name: 'Composite', + class_name: 'NotebookWorkspace' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation.rb new file mode 100644 index 000000000..1c80360b9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # REST API operation + # + class Operation + + include MsRestAzure + + # @return [String] Operation name: {provider}/{resource}/{operation} + attr_accessor :name + + # @return [OperationDisplay] The object that represents the operation. + attr_accessor :display + + + # + # Mapper for Operation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Operation', + type: { + name: 'Composite', + class_name: 'Operation', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + client_side_validation: true, + required: false, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationDisplay' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb new file mode 100644 index 000000000..955fbf384 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb @@ -0,0 +1,80 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The object that represents the operation. + # + class OperationDisplay + + include MsRestAzure + + # @return [String] Service provider: Microsoft.ResourceProvider + attr_accessor :provider + + # @return [String] Resource on which the operation is performed: Profile, + # endpoint, etc. + attr_accessor :resource + + # @return [String] Operation type: Read, write, delete, etc. + attr_accessor :operation + + # @return [String] Description of operation + attr_accessor :description + + + # + # Mapper for OperationDisplay class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Operation_display', + type: { + name: 'Composite', + class_name: 'OperationDisplay', + model_properties: { + provider: { + client_side_validation: true, + required: false, + serialized_name: 'Provider', + type: { + name: 'String' + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'Resource', + type: { + name: 'String' + } + }, + operation: { + client_side_validation: true, + required: false, + serialized_name: 'Operation', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'Description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb new file mode 100644 index 000000000..8ef187e7a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # 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. + # + class OperationListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] List of operations supported by the Resource + # Provider. + attr_accessor :value + + # @return [String] URL to get the next set of operation list results if + # there are any. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [OperationListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for OperationListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationListResult', + type: { + name: 'Composite', + class_name: 'OperationListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'OperationElementType', + type: { + name: 'Composite', + class_name: 'Operation' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb new file mode 100644 index 000000000..17da93c0f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB options resource object + # + class OptionsResource + + include MsRestAzure + + # @return [Integer] Value of the Cosmos DB resource throughput or + # autoscaleSettings. Use the ThroughputSetting resource when retrieving + # offer details. + attr_accessor :throughput + + # @return [AutoscaleSettings] Specifies the Autoscale settings. + attr_accessor :autoscale_settings + + + # + # Mapper for OptionsResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OptionsResource', + type: { + name: 'Composite', + class_name: 'OptionsResource', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb new file mode 100644 index 000000000..815ac5308 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for PartitionKind + # + module PartitionKind + Hash = "Hash" + Range = "Range" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb new file mode 100644 index 000000000..50c7e4fb6 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb @@ -0,0 +1,124 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The metric values for a single partition. + # + class PartitionMetric < Metric + + include MsRestAzure + + # @return [String] The partition id (GUID identifier) of the metric + # values. + attr_accessor :partition_id + + # @return [String] The partition key range id (integer identifier) of the + # metric values. + attr_accessor :partition_key_range_id + + + # + # Mapper for PartitionMetric class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionMetric', + type: { + name: 'Composite', + class_name: 'PartitionMetric', + model_properties: { + start_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + end_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'endTime', + type: { + name: 'DateTime' + } + }, + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + metric_values: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricValues', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'MetricValueElementType', + type: { + name: 'Composite', + class_name: 'MetricValue' + } + } + } + }, + partition_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionId', + type: { + name: 'String' + } + }, + partition_key_range_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionKeyRangeId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb new file mode 100644 index 000000000..159d8b6de --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The response to a list partition metrics request. + # + class PartitionMetricListResult + + include MsRestAzure + + # @return [Array] The list of partition-level metrics + # for the account. + attr_accessor :value + + + # + # Mapper for PartitionMetricListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionMetricListResult', + type: { + name: 'Composite', + class_name: 'PartitionMetricListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PartitionMetricElementType', + type: { + name: 'Composite', + class_name: 'PartitionMetric' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb new file mode 100644 index 000000000..d35138589 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb @@ -0,0 +1,105 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The partition level usage data for a usage request. + # + class PartitionUsage < Usage + + include MsRestAzure + + # @return [String] The partition id (GUID identifier) of the usages. + attr_accessor :partition_id + + # @return [String] The partition key range id (integer identifier) of the + # usages. + attr_accessor :partition_key_range_id + + + # + # Mapper for PartitionUsage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionUsage', + type: { + name: 'Composite', + class_name: 'PartitionUsage', + model_properties: { + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + quota_period: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'quotaPeriod', + type: { + name: 'String' + } + }, + limit: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'limit', + type: { + name: 'Number' + } + }, + current_value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'currentValue', + type: { + name: 'Number' + } + }, + partition_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionId', + type: { + name: 'String' + } + }, + partition_key_range_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'partitionKeyRangeId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb new file mode 100644 index 000000000..20b3990f5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The response to a list partition level usage request. + # + class PartitionUsagesResult + + include MsRestAzure + + # @return [Array] The list of partition-level usages for + # the database. A usage is a point in time metric + attr_accessor :value + + + # + # Mapper for PartitionUsagesResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartitionUsagesResult', + type: { + name: 'Composite', + class_name: 'PartitionUsagesResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PartitionUsageElementType', + type: { + name: 'Composite', + class_name: 'PartitionUsage' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb new file mode 100644 index 000000000..068b202d0 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb @@ -0,0 +1,120 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Percentile Metric data + # + class PercentileMetric + + include MsRestAzure + + # @return [DateTime] The start time for the metric (ISO-8601 format). + attr_accessor :start_time + + # @return [DateTime] The end time for the metric (ISO-8601 format). + attr_accessor :end_time + + # @return [String] The time grain to be used to summarize the metric + # values. + attr_accessor :time_grain + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + # @return [Array] The percentile metric values for + # the specified time window and timestep. + attr_accessor :metric_values + + + # + # Mapper for PercentileMetric class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetric', + type: { + name: 'Composite', + class_name: 'PercentileMetric', + model_properties: { + start_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + end_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'endTime', + type: { + name: 'DateTime' + } + }, + time_grain: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timeGrain', + type: { + name: 'String' + } + }, + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + metric_values: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'metricValues', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricValueElementType', + type: { + name: 'Composite', + class_name: 'PercentileMetricValue' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb new file mode 100644 index 000000000..50fcb2ac9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The response to a list percentile metrics request. + # + class PercentileMetricListResult + + include MsRestAzure + + # @return [Array] The list of percentile metrics for + # the account. + attr_accessor :value + + + # + # Mapper for PercentileMetricListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricListResult', + type: { + name: 'Composite', + class_name: 'PercentileMetricListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricElementType', + type: { + name: 'Composite', + class_name: 'PercentileMetric' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb new file mode 100644 index 000000000..29d5dd3ed --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb @@ -0,0 +1,173 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Represents percentile metrics values. + # + class PercentileMetricValue < MetricValue + + include MsRestAzure + + # @return [Float] The 10th percentile value for the metric. + attr_accessor :p10 + + # @return [Float] The 25th percentile value for the metric. + attr_accessor :p25 + + # @return [Float] The 50th percentile value for the metric. + attr_accessor :p50 + + # @return [Float] The 75th percentile value for the metric. + attr_accessor :p75 + + # @return [Float] The 90th percentile value for the metric. + attr_accessor :p90 + + # @return [Float] The 95th percentile value for the metric. + attr_accessor :p95 + + # @return [Float] The 99th percentile value for the metric. + attr_accessor :p99 + + + # + # Mapper for PercentileMetricValue class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PercentileMetricValue', + type: { + name: 'Composite', + class_name: 'PercentileMetricValue', + model_properties: { + _count: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_count', + type: { + name: 'Double' + } + }, + average: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'average', + type: { + name: 'Double' + } + }, + maximum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'maximum', + type: { + name: 'Double' + } + }, + minimum: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimum', + type: { + name: 'Double' + } + }, + timestamp: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'timestamp', + type: { + name: 'DateTime' + } + }, + total: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'total', + type: { + name: 'Double' + } + }, + p10: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P10', + type: { + name: 'Double' + } + }, + p25: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P25', + type: { + name: 'Double' + } + }, + p50: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P50', + type: { + name: 'Double' + } + }, + p75: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P75', + type: { + name: 'Double' + } + }, + p90: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P90', + type: { + name: 'Double' + } + }, + p95: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P95', + type: { + name: 'Double' + } + }, + p99: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'P99', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb new file mode 100644 index 000000000..a625940b4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for PrimaryAggregationType + # + module PrimaryAggregationType + None = "None" + Average = "Average" + Total = "Total" + Minimum = "Minimum" + Maximum = "Maximum" + Last = "Last" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb new file mode 100644 index 000000000..46ad2cf07 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb @@ -0,0 +1,88 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # A private endpoint connection + # + class PrivateEndpointConnection < ProxyResource + + include MsRestAzure + + # @return [PrivateEndpointProperty] Private endpoint which the connection + # belongs to. + attr_accessor :private_endpoint + + # @return [PrivateLinkServiceConnectionStateProperty] Connection State of + # the Private Endpoint Connection. + attr_accessor :private_link_service_connection_state + + + # + # Mapper for PrivateEndpointConnection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnection', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + private_endpoint: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateEndpoint', + type: { + name: 'Composite', + class_name: 'PrivateEndpointProperty' + } + }, + private_link_service_connection_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateLinkServiceConnectionState', + type: { + name: 'Composite', + class_name: 'PrivateLinkServiceConnectionStateProperty' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb new file mode 100644 index 000000000..165ed3301 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Private endpoint which the connection belongs to. + # + class PrivateEndpointProperty + + include MsRestAzure + + # @return [String] Resource id of the private endpoint. + attr_accessor :id + + + # + # Mapper for PrivateEndpointProperty class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointProperty', + type: { + name: 'Composite', + class_name: 'PrivateEndpointProperty', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb new file mode 100644 index 000000000..a1db872f9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Connection State of the Private Endpoint Connection. + # + class PrivateLinkServiceConnectionStateProperty + + include MsRestAzure + + # @return [String] The private link service connection status. + attr_accessor :status + + # @return [String] Any action that is required beyond basic workflow + # (approve/ reject/ disconnect) + attr_accessor :actions_required + + + # + # Mapper for PrivateLinkServiceConnectionStateProperty class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateLinkServiceConnectionStateProperty', + type: { + name: 'Composite', + class_name: 'PrivateLinkServiceConnectionStateProperty', + model_properties: { + status: { + client_side_validation: true, + required: false, + serialized_name: 'status', + type: { + name: 'String' + } + }, + actions_required: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'actionsRequired', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb new file mode 100644 index 000000000..87236ba2e --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb @@ -0,0 +1,63 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The resource model definition for a ARM proxy resource. It will have + # everything other than required location and tags + # + class ProxyResource < Resource + + include MsRestAzure + + + # + # Mapper for ProxyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ProxyResource', + type: { + name: 'Composite', + class_name: 'ProxyResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/public_network_access.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/public_network_access.rb new file mode 100644 index 000000000..4315beb35 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/public_network_access.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for PublicNetworkAccess + # + module PublicNetworkAccess + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb new file mode 100644 index 000000000..5390efed9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB region to online or offline. + # + class RegionForOnlineOffline + + include MsRestAzure + + # @return [String] Cosmos DB region, with spaces between words and each + # word capitalized. + attr_accessor :region + + + # + # Mapper for RegionForOnlineOffline class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'RegionForOnlineOffline', + type: { + name: 'Composite', + class_name: 'RegionForOnlineOffline', + model_properties: { + region: { + client_side_validation: true, + required: true, + serialized_name: 'region', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/resource.rb new file mode 100644 index 000000000..f8ebe8dbd --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/resource.rb @@ -0,0 +1,83 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class Resource + + include MsRestAzure + + # @return [String] Fully qualified resource Id for the resource. Ex - + # /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + attr_accessor :id + + # @return [String] The name of the resource + attr_accessor :name + + # @return [String] The type of the resource. Ex- + # Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + attr_accessor :type + + + # @return [String] the name of the resource group of the resource. + def resource_group + unless self.id.nil? + groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/) + groups.captures[0].strip if groups + end + end + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/server_version.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/server_version.rb new file mode 100644 index 000000000..a79a747b5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/server_version.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for ServerVersion + # + module ServerVersion + ThreeFullStopTwo = "3.2" + ThreeFullStopSix = "3.6" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb new file mode 100644 index 000000000..eeb76de1b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb @@ -0,0 +1,67 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class SpatialSpec + + include MsRestAzure + + # @return [String] The path for which the indexing behavior applies to. + # Index paths typically start with root and end with wildcard (/path/*) + attr_accessor :path + + # @return [Array] List of path's spatial type + attr_accessor :types + + + # + # Mapper for SpatialSpec class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SpatialSpec', + type: { + name: 'Composite', + class_name: 'SpatialSpec', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + types: { + client_side_validation: true, + required: false, + serialized_name: 'types', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SpatialTypeElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/spatial_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/spatial_type.rb new file mode 100644 index 000000000..e14af54b5 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/spatial_type.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for SpatialType + # + module SpatialType + Point = "Point" + LineString = "LineString" + Polygon = "Polygon" + MultiPolygon = "MultiPolygon" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb new file mode 100644 index 000000000..afd82d986 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB container. + # + class SqlContainerCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlContainerResource] The standard JSON format of a container + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlContainerCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlContainerCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlContainerResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb new file mode 100644 index 000000000..c8658b851 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class SqlContainerGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for SqlContainerGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerGetProperties_options', + type: { + name: 'Composite', + class_name: 'SqlContainerGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb new file mode 100644 index 000000000..2353e077a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb @@ -0,0 +1,150 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class SqlContainerGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL container + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # container + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the container. + attr_accessor :conflict_resolution_policy + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlContainerGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlContainerGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb new file mode 100644 index 000000000..b3867b280 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB container. + # + class SqlContainerGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlContainerGetPropertiesResource] + attr_accessor :resource + + # @return [SqlContainerGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for SqlContainerGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerGetResults', + type: { + name: 'Composite', + class_name: 'SqlContainerGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlContainerGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'SqlContainerGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb new file mode 100644 index 000000000..c23f87040 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the containers and their + # properties. + # + class SqlContainerListResult + + include MsRestAzure + + # @return [Array] List of containers and their + # properties. + attr_accessor :value + + + # + # Mapper for SqlContainerListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerListResult', + type: { + name: 'Composite', + class_name: 'SqlContainerListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlContainerGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb new file mode 100644 index 000000000..96280b425 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB SQL container resource object + # + class SqlContainerResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL container + attr_accessor :id + + # @return [IndexingPolicy] The configuration of the indexing policy. By + # default, the indexing is automatic for all document paths within the + # container + attr_accessor :indexing_policy + + # @return [ContainerPartitionKey] The configuration of the partition key + # to be used for partitioning data into multiple partitions + attr_accessor :partition_key + + # @return [Integer] Default time to live + attr_accessor :default_ttl + + # @return [UniqueKeyPolicy] The unique key policy configuration for + # specifying uniqueness constraints on documents in the collection in the + # Azure Cosmos DB service. + attr_accessor :unique_key_policy + + # @return [ConflictResolutionPolicy] The conflict resolution policy for + # the container. + attr_accessor :conflict_resolution_policy + + + # + # Mapper for SqlContainerResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlContainerResource', + type: { + name: 'Composite', + class_name: 'SqlContainerResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + indexing_policy: { + client_side_validation: true, + required: false, + serialized_name: 'indexingPolicy', + type: { + name: 'Composite', + class_name: 'IndexingPolicy' + } + }, + partition_key: { + client_side_validation: true, + required: false, + serialized_name: 'partitionKey', + type: { + name: 'Composite', + class_name: 'ContainerPartitionKey' + } + }, + default_ttl: { + client_side_validation: true, + required: false, + serialized_name: 'defaultTtl', + type: { + name: 'Number' + } + }, + unique_key_policy: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy' + } + }, + conflict_resolution_policy: { + client_side_validation: true, + required: false, + serialized_name: 'conflictResolutionPolicy', + type: { + name: 'Composite', + class_name: 'ConflictResolutionPolicy' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb new file mode 100644 index 000000000..269a8e5aa --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB SQL database. + # + class SqlDatabaseCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlDatabaseResource] The standard JSON format of a SQL + # database + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlDatabaseCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlDatabaseCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb new file mode 100644 index 000000000..c6cb7e3c2 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class SqlDatabaseGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for SqlDatabaseGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseGetProperties_options', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb new file mode 100644 index 000000000..567e4a66b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb @@ -0,0 +1,109 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class SqlDatabaseGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL database + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + # @return [String] A system generated property that specified the + # addressable path of the collections resource. + attr_accessor :_colls + + # @return [String] A system generated property that specifies the + # addressable path of the users resource. + attr_accessor :_users + + + # + # Mapper for SqlDatabaseGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + }, + _colls: { + client_side_validation: true, + required: false, + serialized_name: '_colls', + type: { + name: 'String' + } + }, + _users: { + client_side_validation: true, + required: false, + serialized_name: '_users', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb new file mode 100644 index 000000000..de8ad7863 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB SQL database. + # + class SqlDatabaseGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlDatabaseGetPropertiesResource] + attr_accessor :resource + + # @return [SqlDatabaseGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for SqlDatabaseGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseGetResults', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb new file mode 100644 index 000000000..c022b8784 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the SQL databases and their + # properties. + # + class SqlDatabaseListResult + + include MsRestAzure + + # @return [Array] List of SQL databases and their + # properties. + attr_accessor :value + + + # + # Mapper for SqlDatabaseListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseListResult', + type: { + name: 'Composite', + class_name: 'SqlDatabaseListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlDatabaseGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb new file mode 100644 index 000000000..02181f08b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB SQL database resource object + # + class SqlDatabaseResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL database + attr_accessor :id + + + # + # Mapper for SqlDatabaseResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlDatabaseResource', + type: { + name: 'Composite', + class_name: 'SqlDatabaseResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb new file mode 100644 index 000000000..e28e98176 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB storedProcedure. + # + class SqlStoredProcedureCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlStoredProcedureResource] The standard JSON format of a + # storedProcedure + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlStoredProcedureCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb new file mode 100644 index 000000000..8b5a635e4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class SqlStoredProcedureGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL storedProcedure + attr_accessor :id + + # @return [String] Body of the Stored Procedure + attr_accessor :body + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlStoredProcedureGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb new file mode 100644 index 000000000..426623793 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB storedProcedure. + # + class SqlStoredProcedureGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlStoredProcedureGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for SqlStoredProcedureGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureGetResults', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb new file mode 100644 index 000000000..8d0519b95 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the storedProcedures and their + # properties. + # + class SqlStoredProcedureListResult + + include MsRestAzure + + # @return [Array] List of storedProcedures + # and their properties. + attr_accessor :value + + + # + # Mapper for SqlStoredProcedureListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureListResult', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb new file mode 100644 index 000000000..9fbffc924 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB SQL storedProcedure resource object + # + class SqlStoredProcedureResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL storedProcedure + attr_accessor :id + + # @return [String] Body of the Stored Procedure + attr_accessor :body + + + # + # Mapper for SqlStoredProcedureResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlStoredProcedureResource', + type: { + name: 'Composite', + class_name: 'SqlStoredProcedureResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb new file mode 100644 index 000000000..83e15d9eb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB trigger. + # + class SqlTriggerCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlTriggerResource] The standard JSON format of a trigger + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlTriggerCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlTriggerCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlTriggerResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb new file mode 100644 index 000000000..453da7a59 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb @@ -0,0 +1,121 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class SqlTriggerGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL trigger + attr_accessor :id + + # @return [String] Body of the Trigger + attr_accessor :body + + # @return [TriggerType] Type of the Trigger. Possible values include: + # 'Pre', 'Post' + attr_accessor :trigger_type + + # @return [TriggerOperation] The operation the trigger is associated + # with. Possible values include: 'All', 'Create', 'Update', 'Delete', + # 'Replace' + attr_accessor :trigger_operation + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlTriggerGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + trigger_type: { + client_side_validation: true, + required: false, + serialized_name: 'triggerType', + type: { + name: 'String' + } + }, + trigger_operation: { + client_side_validation: true, + required: false, + serialized_name: 'triggerOperation', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb new file mode 100644 index 000000000..9708975fa --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB trigger. + # + class SqlTriggerGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlTriggerGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for SqlTriggerGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerGetResults', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb new file mode 100644 index 000000000..b387124a3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the triggers and their + # properties. + # + class SqlTriggerListResult + + include MsRestAzure + + # @return [Array] List of triggers and their + # properties. + attr_accessor :value + + + # + # Mapper for SqlTriggerListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerListResult', + type: { + name: 'Composite', + class_name: 'SqlTriggerListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlTriggerGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb new file mode 100644 index 000000000..003372d4f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb @@ -0,0 +1,82 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB SQL trigger resource object + # + class SqlTriggerResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL trigger + attr_accessor :id + + # @return [String] Body of the Trigger + attr_accessor :body + + # @return [TriggerType] Type of the Trigger. Possible values include: + # 'Pre', 'Post' + attr_accessor :trigger_type + + # @return [TriggerOperation] The operation the trigger is associated + # with. Possible values include: 'All', 'Create', 'Update', 'Delete', + # 'Replace' + attr_accessor :trigger_operation + + + # + # Mapper for SqlTriggerResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlTriggerResource', + type: { + name: 'Composite', + class_name: 'SqlTriggerResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + trigger_type: { + client_side_validation: true, + required: false, + serialized_name: 'triggerType', + type: { + name: 'String' + } + }, + trigger_operation: { + client_side_validation: true, + required: false, + serialized_name: 'triggerOperation', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb new file mode 100644 index 000000000..a6da2e5f4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb @@ -0,0 +1,113 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB userDefinedFunction. + # + class SqlUserDefinedFunctionCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [SqlUserDefinedFunctionResource] The standard JSON format of a + # userDefinedFunction + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for SqlUserDefinedFunctionCreateUpdateParameters class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb new file mode 100644 index 000000000..72d1b229c --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class SqlUserDefinedFunctionGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL userDefinedFunction + attr_accessor :id + + # @return [String] Body of the User Defined Function + attr_accessor :body + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for SqlUserDefinedFunctionGetPropertiesResource class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionGetProperties_resource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb new file mode 100644 index 000000000..0e9a3d768 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB userDefinedFunction. + # + class SqlUserDefinedFunctionGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [SqlUserDefinedFunctionGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for SqlUserDefinedFunctionGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionGetResults', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb new file mode 100644 index 000000000..ea36d9c17 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the userDefinedFunctions and + # their properties. + # + class SqlUserDefinedFunctionListResult + + include MsRestAzure + + # @return [Array] List of + # userDefinedFunctions and their properties. + attr_accessor :value + + + # + # Mapper for SqlUserDefinedFunctionListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionListResult', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionGetResultsElementType', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb new file mode 100644 index 000000000..5a28c34c6 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB SQL userDefinedFunction resource object + # + class SqlUserDefinedFunctionResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB SQL userDefinedFunction + attr_accessor :id + + # @return [String] Body of the User Defined Function + attr_accessor :body + + + # + # Mapper for SqlUserDefinedFunctionResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlUserDefinedFunctionResource', + type: { + name: 'Composite', + class_name: 'SqlUserDefinedFunctionResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + body: { + client_side_validation: true, + required: false, + serialized_name: 'body', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb new file mode 100644 index 000000000..fc521c77a --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to create and update Cosmos DB Table. + # + class TableCreateUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [TableResource] The standard JSON format of a Table + attr_accessor :resource + + # @return [CreateUpdateOptions] A key-value pair of options to be applied + # for the request. This corresponds to the headers sent with the request. + attr_accessor :options + + + # + # Mapper for TableCreateUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableCreateUpdateParameters', + type: { + name: 'Composite', + class_name: 'TableCreateUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'TableResource' + } + }, + options: { + client_side_validation: true, + required: true, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'CreateUpdateOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb new file mode 100644 index 000000000..da55fe301 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class TableGetPropertiesOptions < OptionsResource + + include MsRestAzure + + + # + # Mapper for TableGetPropertiesOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableGetProperties_options', + type: { + name: 'Composite', + class_name: 'TableGetPropertiesOptions', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb new file mode 100644 index 000000000..a8a8d3f03 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class TableGetPropertiesResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB table + attr_accessor :id + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for TableGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableGetProperties_resource', + type: { + name: 'Composite', + class_name: 'TableGetPropertiesResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb new file mode 100644 index 000000000..a4ab4abbb --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB Table. + # + class TableGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [TableGetPropertiesResource] + attr_accessor :resource + + # @return [TableGetPropertiesOptions] + attr_accessor :options + + + # + # Mapper for TableGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableGetResults', + type: { + name: 'Composite', + class_name: 'TableGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'TableGetPropertiesResource' + } + }, + options: { + client_side_validation: true, + required: false, + serialized_name: 'properties.options', + type: { + name: 'Composite', + class_name: 'TableGetPropertiesOptions' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb new file mode 100644 index 000000000..f0b031ed4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The List operation response, that contains the Table and their + # properties. + # + class TableListResult + + include MsRestAzure + + # @return [Array] List of Table and their properties. + attr_accessor :value + + + # + # Mapper for TableListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableListResult', + type: { + name: 'Composite', + class_name: 'TableListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TableGetResultsElementType', + type: { + name: 'Composite', + class_name: 'TableGetResults' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb new file mode 100644 index 000000000..ad476885f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB table resource object + # + class TableResource + + include MsRestAzure + + # @return [String] Name of the Cosmos DB table + attr_accessor :id + + + # + # Mapper for TableResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TableResource', + type: { + name: 'Composite', + class_name: 'TableResource', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb new file mode 100644 index 000000000..54b075246 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB resource throughput policy + # + class ThroughputPolicyResource + + include MsRestAzure + + # @return [Boolean] Determines whether the ThroughputPolicy is active or + # not + attr_accessor :is_enabled + + # @return [Integer] Represents the percentage by which throughput can + # increase every time throughput policy kicks in. + attr_accessor :increment_percent + + + # + # Mapper for ThroughputPolicyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputPolicyResource', + type: { + name: 'Composite', + class_name: 'ThroughputPolicyResource', + model_properties: { + is_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'isEnabled', + type: { + name: 'Boolean' + } + }, + increment_percent: { + client_side_validation: true, + required: false, + serialized_name: 'incrementPercent', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb new file mode 100644 index 000000000..2eaa1bb3c --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb @@ -0,0 +1,124 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Model object. + # + # + class ThroughputSettingsGetPropertiesResource + + include MsRestAzure + + # @return [Integer] Value of the Cosmos DB resource throughput. Either + # throughput is required or autoscaleSettings is required, but not both. + attr_accessor :throughput + + # @return [AutoscaleSettingsResource] Cosmos DB resource for autoscale + # settings. Either throughput is required or autoscaleSettings is + # required, but not both. + attr_accessor :autoscale_settings + + # @return [String] The minimum throughput of the resource + attr_accessor :minimum_throughput + + # @return [String] The throughput replace is pending + attr_accessor :offer_replace_pending + + # @return [String] A system generated property. A unique identifier. + attr_accessor :_rid + + # @return A system generated property that denotes the last updated + # timestamp of the resource. + attr_accessor :_ts + + # @return [String] A system generated property representing the resource + # etag required for optimistic concurrency control. + attr_accessor :_etag + + + # + # Mapper for ThroughputSettingsGetPropertiesResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsGetProperties_resource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsGetPropertiesResource', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettingsResource' + } + }, + minimum_throughput: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimumThroughput', + type: { + name: 'String' + } + }, + offer_replace_pending: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'offerReplacePending', + type: { + name: 'String' + } + }, + _rid: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_rid', + type: { + name: 'String' + } + }, + _ts: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_ts', + type: { + name: 'Object' + } + }, + _etag: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: '_etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb new file mode 100644 index 000000000..587a1aa91 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # An Azure Cosmos DB resource throughput. + # + class ThroughputSettingsGetResults < ARMResourceProperties + + include MsRestAzure + + # @return [ThroughputSettingsGetPropertiesResource] + attr_accessor :resource + + + # + # Mapper for ThroughputSettingsGetResults class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsGetResults', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsGetResults', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsGetPropertiesResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb new file mode 100644 index 000000000..aa534cf65 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb @@ -0,0 +1,86 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Cosmos DB resource throughput object. Either throughput is required or + # autoscaleSettings is required, but not both. + # + class ThroughputSettingsResource + + include MsRestAzure + + # @return [Integer] Value of the Cosmos DB resource throughput. Either + # throughput is required or autoscaleSettings is required, but not both. + attr_accessor :throughput + + # @return [AutoscaleSettingsResource] Cosmos DB resource for autoscale + # settings. Either throughput is required or autoscaleSettings is + # required, but not both. + attr_accessor :autoscale_settings + + # @return [String] The minimum throughput of the resource + attr_accessor :minimum_throughput + + # @return [String] The throughput replace is pending + attr_accessor :offer_replace_pending + + + # + # Mapper for ThroughputSettingsResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsResource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsResource', + model_properties: { + throughput: { + client_side_validation: true, + required: false, + serialized_name: 'throughput', + type: { + name: 'Number' + } + }, + autoscale_settings: { + client_side_validation: true, + required: false, + serialized_name: 'autoscaleSettings', + type: { + name: 'Composite', + class_name: 'AutoscaleSettingsResource' + } + }, + minimum_throughput: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minimumThroughput', + type: { + name: 'String' + } + }, + offer_replace_pending: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'offerReplacePending', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb new file mode 100644 index 000000000..2927ff8e2 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb @@ -0,0 +1,99 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Parameters to update Cosmos DB resource throughput. + # + class ThroughputSettingsUpdateParameters < ARMResourceProperties + + include MsRestAzure + + # @return [ThroughputSettingsResource] The standard JSON format of a + # resource throughput + attr_accessor :resource + + + # + # Mapper for ThroughputSettingsUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ThroughputSettingsUpdateParameters', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsUpdateParameters', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resource', + type: { + name: 'Composite', + class_name: 'ThroughputSettingsResource' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb new file mode 100644 index 000000000..2cfbff13b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb @@ -0,0 +1,92 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The resource model definition for a ARM tracked top level resource + # + class TrackedResource < Resource + + include MsRestAzure + + # @return [Hash{String => String}] Resource tags. + attr_accessor :tags + + # @return [String] The geo-location where the resource lives + attr_accessor :location + + + # + # Mapper for TrackedResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TrackedResource', + type: { + name: 'Composite', + class_name: 'TrackedResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb new file mode 100644 index 000000000..d0ec763c3 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for TriggerOperation + # + module TriggerOperation + All = "All" + Create = "Create" + Update = "Update" + Delete = "Delete" + Replace = "Replace" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb new file mode 100644 index 000000000..0fb1199e4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for TriggerType + # + module TriggerType + Pre = "Pre" + Post = "Post" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb new file mode 100644 index 000000000..c22521972 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The unique key on that enforces uniqueness constraint on documents in the + # collection in the Azure Cosmos DB service. + # + class UniqueKey + + include MsRestAzure + + # @return [Array] List of paths must be unique for each document + # in the Azure Cosmos DB service + attr_accessor :paths + + + # + # Mapper for UniqueKey class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UniqueKey', + type: { + name: 'Composite', + class_name: 'UniqueKey', + model_properties: { + paths: { + client_side_validation: true, + required: false, + serialized_name: 'paths', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb new file mode 100644 index 000000000..126bd8ff4 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The unique key policy configuration for specifying uniqueness constraints + # on documents in the collection in the Azure Cosmos DB service. + # + class UniqueKeyPolicy + + include MsRestAzure + + # @return [Array] List of unique keys on that enforces + # uniqueness constraint on documents in the collection in the Azure + # Cosmos DB service. + attr_accessor :unique_keys + + + # + # Mapper for UniqueKeyPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UniqueKeyPolicy', + type: { + name: 'Composite', + class_name: 'UniqueKeyPolicy', + model_properties: { + unique_keys: { + client_side_validation: true, + required: false, + serialized_name: 'uniqueKeys', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'UniqueKeyElementType', + type: { + name: 'Composite', + class_name: 'UniqueKey' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb new file mode 100644 index 000000000..dc566631d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb @@ -0,0 +1,21 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Defines values for UnitType + # + module UnitType + Count = "Count" + Bytes = "Bytes" + Seconds = "Seconds" + Percent = "Percent" + CountPerSecond = "CountPerSecond" + BytesPerSecond = "BytesPerSecond" + Milliseconds = "Milliseconds" + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/usage.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/usage.rb new file mode 100644 index 000000000..b4c6cf8a9 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/usage.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The usage data for a usage request. + # + class Usage + + include MsRestAzure + + # @return [UnitType] The unit of the metric. Possible values include: + # 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + # 'BytesPerSecond', 'Milliseconds' + attr_accessor :unit + + # @return [MetricName] The name information for the metric. + attr_accessor :name + + # @return [String] The quota period used to summarize the usage values. + attr_accessor :quota_period + + # @return [Integer] Maximum value for this metric + attr_accessor :limit + + # @return [Integer] Current value for this metric + attr_accessor :current_value + + + # + # Mapper for Usage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Usage', + type: { + name: 'Composite', + class_name: 'Usage', + model_properties: { + unit: { + client_side_validation: true, + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'MetricName' + } + }, + quota_period: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'quotaPeriod', + type: { + name: 'String' + } + }, + limit: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'limit', + type: { + name: 'Number' + } + }, + current_value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'currentValue', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb new file mode 100644 index 000000000..07e234185 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # The response to a list usage request. + # + class UsagesResult + + include MsRestAzure + + # @return [Array] The list of usages for the database. A usage is + # a point in time metric + attr_accessor :value + + + # + # Mapper for UsagesResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UsagesResult', + type: { + name: 'Composite', + class_name: 'UsagesResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'UsageElementType', + type: { + name: 'Composite', + class_name: 'Usage' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb new file mode 100644 index 000000000..12549713b --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + module Models + # + # Virtual Network ACL Rule object + # + class VirtualNetworkRule + + include MsRestAzure + + # @return [String] Resource ID of a subnet, for example: + # /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + attr_accessor :id + + # @return [Boolean] Create firewall rule before the virtual network has + # vnet service endpoint enabled. + attr_accessor :ignore_missing_vnet_service_endpoint + + + # + # Mapper for VirtualNetworkRule class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkRule', + type: { + name: 'Composite', + class_name: 'VirtualNetworkRule', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + ignore_missing_vnet_service_endpoint: { + client_side_validation: true, + required: false, + serialized_name: 'ignoreMissingVNetServiceEndpoint', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/module_definition.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/module_definition.rb new file mode 100644 index 000000000..b7d882a87 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/module_definition.rb @@ -0,0 +1,9 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::Cosmosdb end +module Azure::Cosmosdb::Mgmt end +module Azure::Cosmosdb::Mgmt::V2020_04_01 end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb new file mode 100644 index 000000000..b92675785 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb @@ -0,0 +1,1706 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class MongoDBResources + include MsRestAzure + + # + # Creates and initializes a new instance of the MongoDBResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the MongoDB databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseListResult] operation results. + # + def list_mongo_dbdatabases(resource_group_name, account_name, custom_headers:nil) + response = list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the MongoDB databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_mongo_dbdatabases_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the MongoDB databases under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MongoDBDatabaseListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the MongoDB databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseGetResults] operation results. + # + def get_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the MongoDB databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the MongoDB databases under an existing Azure Cosmos DB database account + # with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MongoDBDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseGetResults] operation results. + # + def create_update_mongo_dbdatabase(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + response = create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MongoDBDatabaseGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) + response = delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) + # Send request + promise = begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the MongoDB database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the MongoDB database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbdatabase_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the MongoDB database under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionListResult] operation results. + # + def list_mongo_dbcollections(resource_group_name, account_name, database_name, custom_headers:nil) + response = list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_mongo_dbcollections_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Lists the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MongoDBCollectionListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionGetResults] operation results. + # + def get_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + end + + # + # Gets the MongoDB collection under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MongoDBCollectionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionGetResults] operation results. + # + def create_update_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + response = create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MongoDBCollectionGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + # Send request + promise = begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the MongoDB collection under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the MongoDB collection under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_mongo_dbcollection_throughput_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the MongoDB collection under an existing Azure + # Cosmos DB database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + response = update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBDatabaseGetResults] operation results. + # + def begin_create_update_mongo_dbdatabase(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + response = begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! + end + + # + # Create or updates Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_mongo_dbdatabase_parameters + # [MongoDBDatabaseCreateUpdateParameters] The parameters to provide for the + # current MongoDB database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_mongo_dbdatabase_parameters is nil' if create_update_mongo_dbdatabase_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MongoDBDatabaseCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_mongo_dbdatabase_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MongoDBDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) + response = begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB MongoDB database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_mongo_dbdatabase_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of the an Azure Cosmos DB MongoDB database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MongoDBCollectionGetResults] operation results. + # + def begin_create_update_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + response = begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB MongoDB Collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param create_update_mongo_dbcollection_parameters + # [MongoDBCollectionCreateUpdateParameters] The parameters to provide for the + # current MongoDB Collection. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_mongo_dbcollection_parameters is nil' if create_update_mongo_dbcollection_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MongoDBCollectionCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_mongo_dbcollection_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::MongoDBCollectionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + response = begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB MongoDB Collection. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_mongo_dbcollection_throughput_with_http_info(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update the RUs per second of an Azure Cosmos DB MongoDB collection + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param collection_name [String] Cosmos DB collection name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # RUs per second of the parameters to provide for the current MongoDB + # collection. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'collection_name is nil' if collection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'collectionName' => collection_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb new file mode 100644 index 000000000..7411f3496 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb @@ -0,0 +1,907 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class NotebookWorkspaces + include MsRestAzure + + # + # Creates and initializes a new instance of the NotebookWorkspaces class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Gets the notebook workspace resources of an existing Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspaceListResult] operation results. + # + def list_by_database_account(resource_group_name, account_name, custom_headers:nil) + response = list_by_database_account_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the notebook workspace resources of an existing Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_database_account_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_by_database_account_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Gets the notebook workspace resources of an existing Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_database_account_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::NotebookWorkspaceListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspace] operation results. + # + def get(resource_group_name, account_name, custom_headers:nil) + response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, account_name, custom_headers:nil) + get_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Gets the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::NotebookWorkspace.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspace] operation results. + # + def create_or_update(resource_group_name, account_name, custom_headers:nil) + response = create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::NotebookWorkspace.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, account_name, custom_headers:nil) + response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Retrieves the connection info for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspaceConnectionInfoResult] operation results. + # + def list_connection_info(resource_group_name, account_name, custom_headers:nil) + response = list_connection_info_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the connection info for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_connection_info_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_connection_info_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Retrieves the connection info for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_connection_info_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::NotebookWorkspaceConnectionInfoResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def regenerate_auth_token(resource_group_name, account_name, custom_headers:nil) + response = regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def regenerate_auth_token_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def start(resource_group_name, account_name, custom_headers:nil) + response = start_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def start_async(resource_group_name, account_name, custom_headers:nil) + # Send request + promise = begin_start_async(resource_group_name, account_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotebookWorkspace] operation results. + # + def begin_create_or_update(resource_group_name, account_name, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Creates the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + notebook_create_update_parameters = NotebookWorkspaceCreateUpdateParameters.new + unless + end + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::NotebookWorkspaceCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, notebook_create_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::NotebookWorkspace.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, account_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Deletes the notebook workspace for a Cosmos DB account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_regenerate_auth_token(resource_group_name, account_name, custom_headers:nil) + response = begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_regenerate_auth_token_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Regenerates the auth token for the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_start(resource_group_name, account_name, custom_headers:nil) + response = begin_start_async(resource_group_name, account_name, custom_headers:custom_headers).value! + nil + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_start_with_http_info(resource_group_name, account_name, custom_headers:nil) + begin_start_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Starts the notebook workspace + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_start_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + notebook_workspace_name = 'default' + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/operations.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/operations.rb new file mode 100644 index 000000000..4a85f368f --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/operations.rb @@ -0,0 +1,220 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Operations + include MsRestAzure + + # + # Creates and initializes a new instance of the Operations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers:nil) + first_page = list_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.DocumentDB/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::OperationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::OperationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all of the available Cosmos DB Resource Provider operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb new file mode 100644 index 000000000..3f4273a85 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb @@ -0,0 +1,161 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PartitionKeyRangeId + include MsRestAzure + + # + # Creates and initializes a new instance of the PartitionKeyRangeId class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, 'partition_key_range_id is nil' if partition_key_range_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid,'partitionKeyRangeId' => partition_key_range_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb new file mode 100644 index 000000000..4c5eeb04d --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb @@ -0,0 +1,168 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PartitionKeyRangeIdRegion + include MsRestAzure + + # + # Creates and initializes a new instance of the PartitionKeyRangeIdRegion class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartitionMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given partition + # key range id and region. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param region [String] Cosmos DB region, with spaces between words and each + # word capitalized. + # @param database_rid [String] Cosmos DB database rid. + # @param collection_rid [String] Cosmos DB collection rid. + # @param partition_key_range_id [String] Partition Key Range Id for which to + # get data. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'region is nil' if region.nil? + fail ArgumentError, 'database_rid is nil' if database_rid.nil? + fail ArgumentError, 'collection_rid is nil' if collection_rid.nil? + fail ArgumentError, 'partition_key_range_id is nil' if partition_key_range_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'region' => region,'databaseRid' => database_rid,'collectionRid' => collection_rid,'partitionKeyRangeId' => partition_key_range_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::PartitionMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile.rb new file mode 100644 index 000000000..10c44eb99 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile.rb @@ -0,0 +1,146 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class Percentile + include MsRestAzure + + # + # Creates and initializes a new instance of the Percentile class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given database + # account. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PercentileMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given database + # account. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::PercentileMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb new file mode 100644 index 000000000..a89e47dfa --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb @@ -0,0 +1,163 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PercentileSourceTarget + include MsRestAzure + + # + # Creates and initializes a new instance of the PercentileSourceTarget class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given account, + # source and target region. This url is only for PBS and Replication Latency + # data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param source_region [String] Source region from which data is written. + # Cosmos DB region, with spaces between words and each word capitalized. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PercentileMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, source_region, target_region, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, source_region, target_region, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given account, + # source and target region. This url is only for PBS and Replication Latency + # data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param source_region [String] Source region from which data is written. + # Cosmos DB region, with spaces between words and each word capitalized. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, source_region, target_region, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, source_region, target_region, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given account, + # source and target region. This url is only for PBS and Replication Latency + # data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param source_region [String] Source region from which data is written. + # Cosmos DB region, with spaces between words and each word capitalized. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, source_region, target_region, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'source_region is nil' if source_region.nil? + fail ArgumentError, 'target_region is nil' if target_region.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'sourceRegion' => source_region,'targetRegion' => target_region}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::PercentileMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile_target.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile_target.rb new file mode 100644 index 000000000..97b26b655 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/percentile_target.rb @@ -0,0 +1,153 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class PercentileTarget + include MsRestAzure + + # + # Creates and initializes a new instance of the PercentileTarget class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Retrieves the metrics determined by the given filter for the given account + # target region. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PercentileMetricListResult] operation results. + # + def list_metrics(resource_group_name, account_name, target_region, filter, custom_headers:nil) + response = list_metrics_async(resource_group_name, account_name, target_region, filter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Retrieves the metrics determined by the given filter for the given account + # target region. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_metrics_with_http_info(resource_group_name, account_name, target_region, filter, custom_headers:nil) + list_metrics_async(resource_group_name, account_name, target_region, filter, custom_headers:custom_headers).value! + end + + # + # Retrieves the metrics determined by the given filter for the given account + # target region. This url is only for PBS and Replication Latency data + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param target_region [String] Target region to which data is written. Cosmos + # DB region, with spaces between words and each word capitalized. + # @param filter [String] An OData filter expression that describes a subset of + # metrics to return. The parameters that can be filtered are name.value (name + # of the metric, can have an or of multiple names), startTime, endTime, and + # timeGrain. The supported operator is eq. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_metrics_async(resource_group_name, account_name, target_region, filter, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'target_region is nil' if target_region.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'filter is nil' if filter.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'targetRegion' => target_region}, + query_params: {'api-version' => @client.api_version,'$filter' => filter}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::PercentileMetricListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/sql_resources.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/sql_resources.rb new file mode 100644 index 000000000..92ff1c523 --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/sql_resources.rb @@ -0,0 +1,3433 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class SqlResources + include MsRestAzure + + # + # Creates and initializes a new instance of the SqlResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the SQL databases under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseListResult] operation results. + # + def list_sql_databases(resource_group_name, account_name, custom_headers:nil) + response = list_sql_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL databases under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_databases_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_sql_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL databases under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_databases_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlDatabaseListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL database under an existing Azure Cosmos DB database account with + # the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseGetResults] operation results. + # + def get_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL database under an existing Azure Cosmos DB database account with + # the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL database under an existing Azure Cosmos DB database account with + # the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseGetResults] operation results. + # + def create_update_sql_database(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + response = create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlDatabaseGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the SQL database under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_sql_database_throughput(resource_group_name, account_name, database_name, custom_headers:nil) + response = get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the SQL database under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_database_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the SQL database under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_sql_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerListResult] operation results. + # + def list_sql_containers(resource_group_name, account_name, database_name, custom_headers:nil) + response = list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_containers_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlContainerListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerGetResults] operation results. + # + def get_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL container under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlContainerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerGetResults] operation results. + # + def create_update_sql_container(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + response = create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlContainerGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the SQL container under an existing Azure Cosmos + # DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_sql_container_throughput(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the SQL container under an existing Azure Cosmos + # DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_container_throughput_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the SQL container under an existing Azure Cosmos + # DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_sql_container_throughput(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + response = update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureListResult] operation results. + # + def list_sql_stored_procedures(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = list_sql_stored_procedures_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_stored_procedures_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + list_sql_stored_procedures_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_stored_procedures_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlStoredProcedureListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureGetResults] operation results. + # + def get_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + response = get_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + get_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL storedProcedure under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'stored_procedure_name is nil' if stored_procedure_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlStoredProcedureGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureGetResults] operation results. + # + def create_update_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + response = create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlStoredProcedureGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + response = delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionListResult] operation results. + # + def list_sql_user_defined_functions(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = list_sql_user_defined_functions_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_user_defined_functions_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + list_sql_user_defined_functions_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_user_defined_functions_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlUserDefinedFunctionListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionGetResults] operation results. + # + def get_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + response = get_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + get_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + # account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'user_defined_function_name is nil' if user_defined_function_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlUserDefinedFunctionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionGetResults] operation results. + # + def create_update_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + response = create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlUserDefinedFunctionGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + response = delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerListResult] operation results. + # + def list_sql_triggers(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = list_sql_triggers_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_sql_triggers_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + list_sql_triggers_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Lists the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_sql_triggers_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlTriggerListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerGetResults] operation results. + # + def get_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + response = get_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + get_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + end + + # + # Gets the SQL trigger under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'trigger_name is nil' if trigger_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlTriggerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerGetResults] operation results. + # + def create_update_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + response = create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlTriggerGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + response = delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + # Send request + promise = begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlDatabaseGetResults] operation results. + # + def begin_create_update_sql_database(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + response = begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_database_with_http_info(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param create_update_sql_database_parameters + # [SqlDatabaseCreateUpdateParameters] The parameters to provide for the current + # SQL database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_sql_database_parameters is nil' if create_update_sql_database_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlDatabaseCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_database_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlDatabaseGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) + response = begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) + begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL database. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_sql_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_sql_database_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB SQL database + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlContainerGetResults] operation results. + # + def begin_create_update_sql_container(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + response = begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param create_update_sql_container_parameters + # [SqlContainerCreateUpdateParameters] The parameters to provide for the + # current SQL container. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_sql_container_parameters is nil' if create_update_sql_container_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlContainerCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_container_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlContainerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + response = begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL container. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_sql_container_throughput(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_sql_container_throughput_with_http_info(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB SQL container + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current SQL container. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlStoredProcedureGetResults] operation results. + # + def begin_create_update_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + response = begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL storedProcedure + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param create_update_sql_stored_procedure_parameters + # [SqlStoredProcedureCreateUpdateParameters] The parameters to provide for the + # current SQL storedProcedure. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'stored_procedure_name is nil' if stored_procedure_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_sql_stored_procedure_parameters is nil' if create_update_sql_stored_procedure_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlStoredProcedureCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_stored_procedure_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlStoredProcedureGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + response = begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL storedProcedure. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param stored_procedure_name [String] Cosmos DB storedProcedure name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'stored_procedure_name is nil' if stored_procedure_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlUserDefinedFunctionGetResults] operation results. + # + def begin_create_update_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + response = begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL userDefinedFunction + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param create_update_sql_user_defined_function_parameters + # [SqlUserDefinedFunctionCreateUpdateParameters] The parameters to provide for + # the current SQL userDefinedFunction. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'user_defined_function_name is nil' if user_defined_function_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_sql_user_defined_function_parameters is nil' if create_update_sql_user_defined_function_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlUserDefinedFunctionCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_user_defined_function_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlUserDefinedFunctionGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + response = begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param user_defined_function_name [String] Cosmos DB userDefinedFunction + # name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'user_defined_function_name is nil' if user_defined_function_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SqlTriggerGetResults] operation results. + # + def begin_create_update_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + response = begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB SQL trigger + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param create_update_sql_trigger_parameters + # [SqlTriggerCreateUpdateParameters] The parameters to provide for the current + # SQL trigger. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'trigger_name is nil' if trigger_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_sql_trigger_parameters is nil' if create_update_sql_trigger_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlTriggerCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_sql_trigger_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::SqlTriggerGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + response = begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB SQL trigger. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param database_name [String] Cosmos DB database name. + # @param container_name [String] Cosmos DB container name. + # @param trigger_name [String] Cosmos DB trigger name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'trigger_name is nil' if trigger_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/table_resources.rb b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/table_resources.rb new file mode 100644 index 000000000..3e8c621ec --- /dev/null +++ b/management/azure_mgmt_cosmosdb/lib/2020-04-01/generated/azure_mgmt_cosmosdb/table_resources.rb @@ -0,0 +1,840 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Cosmosdb::Mgmt::V2020_04_01 + # + # Azure Cosmos DB Database Service Resource Provider REST API + # + class TableResources + include MsRestAzure + + # + # Creates and initializes a new instance of the TableResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient + attr_reader :client + + # + # Lists the Tables under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableListResult] operation results. + # + def list_tables(resource_group_name, account_name, custom_headers:nil) + response = list_tables_async(resource_group_name, account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Tables under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_tables_with_http_info(resource_group_name, account_name, custom_headers:nil) + list_tables_async(resource_group_name, account_name, custom_headers:custom_headers).value! + end + + # + # Lists the Tables under an existing Azure Cosmos DB database account. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_tables_async(resource_group_name, account_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::TableListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the Tables under an existing Azure Cosmos DB database account with the + # provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableGetResults] operation results. + # + def get_table(resource_group_name, account_name, table_name, custom_headers:nil) + response = get_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the Tables under an existing Azure Cosmos DB database account with the + # provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_table_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) + get_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the Tables under an existing Azure Cosmos DB database account with the + # provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_table_async(resource_group_name, account_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::TableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableGetResults] operation results. + # + def create_update_table(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + response = create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + # Send request + promise = begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::TableGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete_table(resource_group_name, account_name, table_name, custom_headers:nil) + response = delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_table_async(resource_group_name, account_name, table_name, custom_headers:nil) + # Send request + promise = begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Gets the RUs per second of the Table under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def get_table_throughput(resource_group_name, account_name, table_name, custom_headers:nil) + response = get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the RUs per second of the Table under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_table_throughput_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) + get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + end + + # + # Gets the RUs per second of the Table under an existing Azure Cosmos DB + # database account with the provided name. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def update_table_throughput(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + response = update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + # Send request + promise = begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TableGetResults] operation results. + # + def begin_create_update_table(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + response = begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_update_table_with_http_info(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! + end + + # + # Create or update an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param create_update_table_parameters [TableCreateUpdateParameters] The + # parameters to provide for the current Table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'create_update_table_parameters is nil' if create_update_table_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::TableCreateUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, create_update_table_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::TableGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete_table(resource_group_name, account_name, table_name, custom_headers:nil) + response = begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + nil + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_table_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) + begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! + end + + # + # Deletes an existing Azure Cosmos DB Table. + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ThroughputSettingsGetResults] operation results. + # + def begin_update_table_throughput(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + response = begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_table_throughput_with_http_info(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! + end + + # + # Update RUs per second of an Azure Cosmos DB Table + # + # @param resource_group_name [String] The name of the resource group. The name + # is case insensitive. + # @param account_name [String] Cosmos DB database account name. + # @param table_name [String] Cosmos DB table name. + # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The + # parameters to provide for the RUs per second of the current Table. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 + fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 + fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? + fail ArgumentError, 'table_name is nil' if table_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 + fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, update_throughput_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_cosmosdb/lib/azure_mgmt_cosmosdb.rb b/management/azure_mgmt_cosmosdb/lib/azure_mgmt_cosmosdb.rb index 2792bf1ec..517560259 100644 --- a/management/azure_mgmt_cosmosdb/lib/azure_mgmt_cosmosdb.rb +++ b/management/azure_mgmt_cosmosdb/lib/azure_mgmt_cosmosdb.rb @@ -2,7 +2,10 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -require '2015-04-08/generated/azure_mgmt_cosmosdb' -require '2019-08-01/generated/azure_mgmt_cosmosdb' +require '2020-03-01/generated/azure_mgmt_cosmosdb' +require '2019-12-12/generated/azure_mgmt_cosmosdb' require '2019-08-01-preview/generated/azure_mgmt_cosmosdb' +require '2020-04-01/generated/azure_mgmt_cosmosdb' +require '2019-08-01/generated/azure_mgmt_cosmosdb' +require '2015-04-08/generated/azure_mgmt_cosmosdb' require 'profiles/latest/cosmosdb_latest_profile_client' diff --git a/management/azure_mgmt_cosmosdb/lib/version.rb b/management/azure_mgmt_cosmosdb/lib/version.rb index b8afd1e11..eb794092c 100644 --- a/management/azure_mgmt_cosmosdb/lib/version.rb +++ b/management/azure_mgmt_cosmosdb/lib/version.rb @@ -3,5 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. module Azure::Cosmosdb::Mgmt - VERSION = '0.21.1' + VERSION = '0.21.2' end diff --git a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory.rb b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory.rb index 325bf5379..ee5c84dfa 100644 --- a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory.rb +++ b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory.rb @@ -33,98 +33,100 @@ module Azure::DataFactory::Mgmt::V2017_09_01_preview autoload :DataFactoryManagementClient, '2017-09-01-preview/generated/azure_mgmt_data_factory/data_factory_management_client.rb' module Models - autoload :TriggerRunListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/trigger_run_list_response.rb' - autoload :OperationDisplay, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/operation_display.rb' - autoload :SubResource, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/sub_resource.rb' autoload :OperationLogSpecification, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/operation_log_specification.rb' - autoload :ActivityRunsListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/activity_runs_list_response.rb' - autoload :TriggerRun, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/trigger_run.rb' - autoload :SSISExecutionCredential, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssisexecution_credential.rb' - autoload :Resource, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/resource.rb' - autoload :FactoryIdentity, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/factory_identity.rb' - autoload :Expression, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/expression.rb' - autoload :SSISPackageLocation, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssispackage_location.rb' - autoload :SelfHostedIntegrationRuntimeNode, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/self_hosted_integration_runtime_node.rb' - autoload :IntegrationRuntime, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime.rb' autoload :OperationMetricAvailability, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/operation_metric_availability.rb' - autoload :IntegrationRuntimeListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_list_response.rb' + autoload :SubResource, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/sub_resource.rb' autoload :OperationMetricSpecification, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/operation_metric_specification.rb' - autoload :IntegrationRuntimeStatus, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_status.rb' - autoload :OperationServiceSpecification, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/operation_service_specification.rb' - autoload :IntegrationRuntimeStatusListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_status_list_response.rb' - autoload :Operation, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/operation.rb' - autoload :UpdateIntegrationRuntimeNodeRequest, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/update_integration_runtime_node_request.rb' - autoload :OperationListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/operation_list_response.rb' - autoload :LinkedService, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/linked_service.rb' - autoload :SSISPropertyOverride, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssisproperty_override.rb' - autoload :LinkedServiceListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/linked_service_list_response.rb' - autoload :CustomActivityReferenceObject, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/custom_activity_reference_object.rb' - autoload :PolybaseSettings, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/polybase_settings.rb' - autoload :CopySource, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/copy_source.rb' - autoload :ActivityDependency, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/activity_dependency.rb' - autoload :RecurrenceScheduleOccurrence, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/recurrence_schedule_occurrence.rb' + autoload :TriggerRun, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/trigger_run.rb' + autoload :TriggerRunListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/trigger_run_list_response.rb' + autoload :WebActivityAuthentication, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/web_activity_authentication.rb' + autoload :OperationDisplay, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/operation_display.rb' + autoload :FactoryIdentity, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/factory_identity.rb' + autoload :Resource, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/resource.rb' + autoload :RetryPolicy, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/retry_policy.rb' + autoload :Expression, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/expression.rb' + autoload :IntegrationRuntime, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime.rb' autoload :CopySink, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/copy_sink.rb' - autoload :RecurrenceSchedule, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/recurrence_schedule.rb' + autoload :IntegrationRuntimeListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_list_response.rb' + autoload :OperationServiceSpecification, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/operation_service_specification.rb' + autoload :IntegrationRuntimeStatus, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_status.rb' + autoload :Operation, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/operation.rb' + autoload :IntegrationRuntimeStatusListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_status_list_response.rb' + autoload :OperationListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/operation_list_response.rb' + autoload :UpdateIntegrationRuntimeNodeRequest, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/update_integration_runtime_node_request.rb' + autoload :LinkedIntegrationRuntime, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/linked_integration_runtime.rb' + autoload :LinkedService, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/linked_service.rb' + autoload :SelfHostedIntegrationRuntimeNode, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/self_hosted_integration_runtime_node.rb' + autoload :LinkedServiceListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/linked_service_list_response.rb' + autoload :SSISExecutionParameter, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssisexecution_parameter.rb' + autoload :RedirectIncompatibleRowSettings, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/redirect_incompatible_row_settings.rb' + autoload :SSISPropertyOverride, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssisproperty_override.rb' + autoload :ActivityDependency, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/activity_dependency.rb' + autoload :SSISLogLocation, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssislog_location.rb' + autoload :StagingSettings, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/staging_settings.rb' + autoload :RecurrenceScheduleOccurrence, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/recurrence_schedule_occurrence.rb' autoload :Trigger, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/trigger.rb' - autoload :ScheduleTriggerRecurrence, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/schedule_trigger_recurrence.rb' + autoload :RecurrenceSchedule, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/recurrence_schedule.rb' autoload :TriggerListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/trigger_list_response.rb' - autoload :StoredProcedureParameter, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/stored_procedure_parameter.rb' + autoload :ScheduleTriggerRecurrence, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/schedule_trigger_recurrence.rb' autoload :ErrorResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/error_response.rb' - autoload :WebLinkedServiceTypeProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/web_linked_service_type_properties.rb' + autoload :SSISAccessCredential, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssisaccess_credential.rb' autoload :PipelineReference, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_reference.rb' - autoload :DistcpSettings, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/distcp_settings.rb' + autoload :CustomActivityReferenceObject, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/custom_activity_reference_object.rb' autoload :FactoryUpdateParameters, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/factory_update_parameters.rb' autoload :ActivityPolicy, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/activity_policy.rb' autoload :PipelineRunQueryFilter, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_run_query_filter.rb' - autoload :RedshiftUnloadSettings, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/redshift_unload_settings.rb' + autoload :CopySource, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/copy_source.rb' autoload :PipelineRunFilterParameters, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_run_filter_parameters.rb' - autoload :WebActivityAuthentication, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/web_activity_authentication.rb' + autoload :StoredProcedureParameter, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/stored_procedure_parameter.rb' autoload :PipelineRun, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_run.rb' - autoload :AzureMLWebServiceFile, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/azure_mlweb_service_file.rb' + autoload :WebLinkedServiceTypeProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/web_linked_service_type_properties.rb' autoload :ActivityRun, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/activity_run.rb' - autoload :RetryPolicy, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/retry_policy.rb' - autoload :SecretBase, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/secret_base.rb' - autoload :SSISExecutionParameter, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssisexecution_parameter.rb' - autoload :FactoryListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/factory_list_response.rb' - autoload :DatasetCompression, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/dataset_compression.rb' - autoload :IntegrationRuntimeReference, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_reference.rb' - autoload :UpdateIntegrationRuntimeRequest, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/update_integration_runtime_request.rb' - autoload :IntegrationRuntimeConnectionInfo, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_connection_info.rb' - autoload :StagingSettings, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/staging_settings.rb' - autoload :IntegrationRuntimeRegenerateKeyParameters, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_regenerate_key_parameters.rb' - autoload :DatasetListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/dataset_list_response.rb' - autoload :IntegrationRuntimeAuthKeys, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_auth_keys.rb' - autoload :PipelineListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_list_response.rb' - autoload :IntegrationRuntimeRemoveNodeRequest, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_remove_node_request.rb' - autoload :CreateRunResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/create_run_response.rb' - autoload :DatasetStorageFormat, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/dataset_storage_format.rb' - autoload :TriggerPipelineReference, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/trigger_pipeline_reference.rb' - autoload :IntegrationRuntimeMonitoringData, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_monitoring_data.rb' - autoload :PipelineRunQueryOrderBy, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_run_query_order_by.rb' - autoload :IntegrationRuntimeNodeMonitoringData, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_node_monitoring_data.rb' - autoload :PipelineRunQueryResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_run_query_response.rb' - autoload :IntegrationRuntimeNodeIpAddress, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_node_ip_address.rb' - autoload :FactoryVSTSConfiguration, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/factory_vstsconfiguration.rb' - autoload :IntegrationRuntimeComputeProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_compute_properties.rb' - autoload :IntegrationRuntimeStatusResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_status_response.rb' - autoload :IntegrationRuntimeVNetProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_vnet_properties.rb' - autoload :Dataset, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/dataset.rb' - autoload :IntegrationRuntimeSsisProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_properties.rb' - autoload :LinkedIntegrationRuntime, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/linked_integration_runtime.rb' - autoload :IntegrationRuntimeSsisCatalogInfo, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_catalog_info.rb' - autoload :DatasetReference, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/dataset_reference.rb' - autoload :IntegrationRuntimeCustomSetupScriptProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_custom_setup_script_properties.rb' + autoload :DistcpSettings, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/distcp_settings.rb' autoload :LinkedServiceReference, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/linked_service_reference.rb' - autoload :IntegrationRuntimeDataProxyProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_data_proxy_properties.rb' + autoload :AzureMLWebServiceFile, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/azure_mlweb_service_file.rb' + autoload :FactoryVSTSConfiguration, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/factory_vstsconfiguration.rb' + autoload :RedshiftUnloadSettings, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/redshift_unload_settings.rb' + autoload :SSISExecutionCredential, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssisexecution_credential.rb' + autoload :DatasetCompression, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/dataset_compression.rb' + autoload :IntegrationRuntimeStatusResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_status_response.rb' autoload :ParameterSpecification, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/parameter_specification.rb' - autoload :EntityReference, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/entity_reference.rb' - autoload :FactoryRepoUpdate, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/factory_repo_update.rb' - autoload :LinkedIntegrationRuntimeProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/linked_integration_runtime_properties.rb' - autoload :RedirectIncompatibleRowSettings, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/redirect_incompatible_row_settings.rb' - autoload :ManagedIntegrationRuntimeNode, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/managed_integration_runtime_node.rb' - autoload :PipelineRunInvokedBy, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_run_invoked_by.rb' - autoload :ManagedIntegrationRuntimeError, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/managed_integration_runtime_error.rb' + autoload :IntegrationRuntimeConnectionInfo, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_connection_info.rb' + autoload :Dataset, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/dataset.rb' + autoload :IntegrationRuntimeRegenerateKeyParameters, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_regenerate_key_parameters.rb' autoload :Activity, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/activity.rb' + autoload :IntegrationRuntimeAuthKeys, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_auth_keys.rb' + autoload :PolybaseSettings, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/polybase_settings.rb' + autoload :DatasetStorageFormat, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/dataset_storage_format.rb' + autoload :FactoryRepoUpdate, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/factory_repo_update.rb' + autoload :IntegrationRuntimeRemoveNodeRequest, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_remove_node_request.rb' + autoload :DatasetReference, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/dataset_reference.rb' + autoload :IntegrationRuntimeMonitoringData, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_monitoring_data.rb' + autoload :PipelineRunInvokedBy, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_run_invoked_by.rb' + autoload :IntegrationRuntimeNodeMonitoringData, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_node_monitoring_data.rb' + autoload :ActivityRunsListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/activity_runs_list_response.rb' + autoload :IntegrationRuntimeNodeIpAddress, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_node_ip_address.rb' + autoload :FactoryListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/factory_list_response.rb' + autoload :IntegrationRuntimeComputeProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_compute_properties.rb' + autoload :UpdateIntegrationRuntimeRequest, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/update_integration_runtime_request.rb' + autoload :IntegrationRuntimeVNetProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_vnet_properties.rb' + autoload :DatasetListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/dataset_list_response.rb' + autoload :IntegrationRuntimeSsisProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_properties.rb' + autoload :CreateRunResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/create_run_response.rb' + autoload :IntegrationRuntimeSsisCatalogInfo, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_catalog_info.rb' + autoload :PipelineRunQueryOrderBy, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_run_query_order_by.rb' + autoload :IntegrationRuntimeCustomSetupScriptProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_custom_setup_script_properties.rb' + autoload :SecretBase, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/secret_base.rb' + autoload :IntegrationRuntimeDataProxyProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_data_proxy_properties.rb' + autoload :SSISPackageLocation, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssispackage_location.rb' + autoload :EntityReference, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/entity_reference.rb' + autoload :TriggerPipelineReference, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/trigger_pipeline_reference.rb' + autoload :LinkedIntegrationRuntimeProperties, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/linked_integration_runtime_properties.rb' + autoload :IntegrationRuntimeReference, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_reference.rb' + autoload :ManagedIntegrationRuntimeNode, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/managed_integration_runtime_node.rb' + autoload :PipelineRunQueryResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_run_query_response.rb' + autoload :ManagedIntegrationRuntimeError, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/managed_integration_runtime_error.rb' + autoload :PipelineListResponse, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/pipeline_list_response.rb' autoload :ManagedIntegrationRuntimeOperationResult, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/managed_integration_runtime_operation_result.rb' autoload :SecureString, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/secure_string.rb' autoload :AzureKeyVaultSecretReference, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/azure_key_vault_secret_reference.rb' @@ -406,6 +408,7 @@ module Azure::DataFactory::Mgmt::V2017_09_01_preview autoload :DaysOfWeek, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/days_of_week.rb' autoload :RecurrenceFrequency, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/recurrence_frequency.rb' autoload :WebActivityMethod, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/web_activity_method.rb' + autoload :SsisPackageLocationType, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssis_package_location_type.rb' autoload :HDInsightActivityDebugInfoOption, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/hdinsight_activity_debug_info_option.rb' autoload :IntegrationRuntimeType, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/integration_runtime_type.rb' autoload :SelfHostedIntegrationRuntimeNodeStatus, '2017-09-01-preview/generated/azure_mgmt_data_factory/models/self_hosted_integration_runtime_node_status.rb' diff --git a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/data_factory_management_client.rb b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/data_factory_management_client.rb index a622ab8f4..990f0cddd 100644 --- a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/data_factory_management_client.rb +++ b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/data_factory_management_client.rb @@ -160,7 +160,7 @@ module Azure::DataFactory::Mgmt::V2017_09_01_preview # def add_telemetry sdk_information = 'azure_mgmt_data_factory' - sdk_information = "#{sdk_information}/0.18.2" + sdk_information = "#{sdk_information}/0.18.3" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/blob_events_trigger.rb b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/blob_events_trigger.rb index de95b177b..e060a4d4f 100644 --- a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/blob_events_trigger.rb +++ b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/blob_events_trigger.rb @@ -32,6 +32,10 @@ module Azure::DataFactory::Mgmt::V2017_09_01_preview # these must be provided: blobPathBeginsWith, blobPathEndsWith. attr_accessor :blob_path_ends_with + # @return [Boolean] If set to true, blobs with zero bytes will be + # ignored. + attr_accessor :ignore_empty_blobs + # @return [Array] The type of events that cause this # trigger to fire. attr_accessor :events @@ -126,6 +130,14 @@ module Azure::DataFactory::Mgmt::V2017_09_01_preview name: 'String' } }, + ignore_empty_blobs: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.ignoreEmptyBlobs', + type: { + name: 'Boolean' + } + }, events: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/execute_ssispackage_activity.rb b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/execute_ssispackage_activity.rb index adbb9e054..1d5a61ecf 100644 --- a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/execute_ssispackage_activity.rb +++ b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/execute_ssispackage_activity.rb @@ -61,6 +61,9 @@ module Azure::DataFactory::Mgmt::V2017_09_01_preview # to execute the SSIS package. attr_accessor :property_overrides + # @return [SSISLogLocation] SSIS package execution log location. + attr_accessor :log_location + # # Mapper for ExecuteSSISPackageActivity class as Ruby Hash. @@ -301,6 +304,15 @@ module Azure::DataFactory::Mgmt::V2017_09_01_preview } } } + }, + log_location: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.logLocation', + type: { + name: 'Composite', + class_name: 'SSISLogLocation' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssis_package_location_type.rb b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssis_package_location_type.rb new file mode 100644 index 000000000..bbda6bcd1 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssis_package_location_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2017_09_01_preview + module Models + # + # Defines values for SsisPackageLocationType + # + module SsisPackageLocationType + SSISDB = "SSISDB" + File = "File" + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssisaccess_credential.rb b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssisaccess_credential.rb new file mode 100644 index 000000000..f43c8267d --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssisaccess_credential.rb @@ -0,0 +1,71 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2017_09_01_preview + module Models + # + # SSIS access credential. + # + class SSISAccessCredential + + include MsRestAzure + + # @return Domain for windows authentication. + attr_accessor :domain + + # @return UseName for windows authentication. + attr_accessor :user_name + + # @return [SecretBase] Password for windows authentication. + attr_accessor :password + + + # + # Mapper for SSISAccessCredential class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SSISAccessCredential', + type: { + name: 'Composite', + class_name: 'SSISAccessCredential', + model_properties: { + domain: { + client_side_validation: true, + required: true, + serialized_name: 'domain', + type: { + name: 'Object' + } + }, + user_name: { + client_side_validation: true, + required: true, + serialized_name: 'userName', + type: { + name: 'Object' + } + }, + password: { + client_side_validation: true, + required: true, + serialized_name: 'password', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'SecretBase', + class_name: 'SecretBase' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssislog_location.rb b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssislog_location.rb new file mode 100644 index 000000000..f508e5dfc --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssislog_location.rb @@ -0,0 +1,86 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2017_09_01_preview + module Models + # + # SSIS package execution log location + # + class SSISLogLocation + + include MsRestAzure + + # @return The SSIS package execution log path. Type: string (or + # Expression with resultType string). + attr_accessor :log_path + + # @return [String] The type of SSIS log location. Default value: 'File' . + attr_accessor :type + + # @return [SSISAccessCredential] The package execution log access + # credential. + attr_accessor :access_credential + + # @return Specifies the interval to refresh log. The default interval is + # 5 minutes. Type: string (or Expression with resultType string), + # pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + attr_accessor :log_refresh_interval + + + # + # Mapper for SSISLogLocation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SSISLogLocation', + type: { + name: 'Composite', + class_name: 'SSISLogLocation', + model_properties: { + log_path: { + client_side_validation: true, + required: true, + serialized_name: 'logPath', + type: { + name: 'Object' + } + }, + type: { + client_side_validation: true, + required: true, + is_constant: true, + serialized_name: 'type', + default_value: 'File', + type: { + name: 'String' + } + }, + access_credential: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.accessCredential', + type: { + name: 'Composite', + class_name: 'SSISAccessCredential' + } + }, + log_refresh_interval: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.logRefreshInterval', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssispackage_location.rb b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssispackage_location.rb index 951b5fab0..891f5473b 100644 --- a/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssispackage_location.rb +++ b/management/azure_mgmt_data_factory/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/models/ssispackage_location.rb @@ -16,6 +16,20 @@ module Azure::DataFactory::Mgmt::V2017_09_01_preview # resultType string). attr_accessor :package_path + # @return [SsisPackageLocationType] The type of SSIS package location. + # Possible values include: 'SSISDB', 'File' + attr_accessor :type + + # @return [SecretBase] Password of the package. + attr_accessor :package_password + + # @return [SSISAccessCredential] The package access credential. + attr_accessor :access_credential + + # @return The configuration file of the package execution. Type: string + # (or Expression with resultType string). + attr_accessor :configuration_path + # # Mapper for SSISPackageLocation class as Ruby Hash. @@ -37,6 +51,42 @@ module Azure::DataFactory::Mgmt::V2017_09_01_preview type: { name: 'Object' } + }, + type: { + client_side_validation: true, + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + }, + package_password: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.packagePassword', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'SecretBase', + class_name: 'SecretBase' + } + }, + access_credential: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.accessCredential', + type: { + name: 'Composite', + class_name: 'SSISAccessCredential' + } + }, + configuration_path: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.configurationPath', + type: { + name: 'Object' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory.rb index 0afe6d6ab..850a6ba5e 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory.rb @@ -38,166 +38,172 @@ module Azure::DataFactory::Mgmt::V2018_06_01 autoload :DataFactoryManagementClient, '2018-06-01/generated/azure_mgmt_data_factory/data_factory_management_client.rb' module Models - autoload :DataFlowDebugCommandResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_command_response.rb' - autoload :DataFlowDebugSessionInfo, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_session_info.rb' - autoload :SubResource, '2018-06-01/generated/azure_mgmt_data_factory/models/sub_resource.rb' - autoload :QueryDataFlowDebugSessionsResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/query_data_flow_debug_sessions_response.rb' - autoload :Expression, '2018-06-01/generated/azure_mgmt_data_factory/models/expression.rb' - autoload :GetDataFactoryOperationStatusResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/get_data_factory_operation_status_response.rb' - autoload :LinkedServiceReference, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_service_reference.rb' - autoload :DataFlowReference, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_reference.rb' - autoload :SecretBase, '2018-06-01/generated/azure_mgmt_data_factory/models/secret_base.rb' - autoload :DataFlowDebugPackage, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_package.rb' - autoload :FactoryRepoConfiguration, '2018-06-01/generated/azure_mgmt_data_factory/models/factory_repo_configuration.rb' - autoload :AddDataFlowToDebugSessionResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/add_data_flow_to_debug_session_response.rb' - autoload :FactoryListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/factory_list_response.rb' - autoload :DeleteDataFlowDebugSessionRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/delete_data_flow_debug_session_request.rb' - autoload :DataFlowSourceSetting, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_source_setting.rb' autoload :DataFlowStagingInfo, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_staging_info.rb' - autoload :IntegrationRuntimeReference, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_reference.rb' - autoload :DWCopyCommandDefaultValue, '2018-06-01/generated/azure_mgmt_data_factory/models/dwcopy_command_default_value.rb' - autoload :IntegrationRuntimeStatus, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_status.rb' - autoload :DataFlowDebugPackageDebugSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_package_debug_settings.rb' - autoload :IntegrationRuntimeStatusListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_status_list_response.rb' - autoload :UpdateIntegrationRuntimeRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/update_integration_runtime_request.rb' - autoload :ScheduleTriggerRecurrence, '2018-06-01/generated/azure_mgmt_data_factory/models/schedule_trigger_recurrence.rb' - autoload :LinkedIntegrationRuntimeRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_integration_runtime_request.rb' - autoload :IntegrationRuntime, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime.rb' - autoload :ParameterSpecification, '2018-06-01/generated/azure_mgmt_data_factory/models/parameter_specification.rb' - autoload :DWCopyCommandSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/dwcopy_command_settings.rb' - autoload :SSISExecutionCredential, '2018-06-01/generated/azure_mgmt_data_factory/models/ssisexecution_credential.rb' - autoload :DataFlowDebugCommandPayload, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_command_payload.rb' - autoload :DatasetFolder, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_folder.rb' - autoload :DataFlowDebugCommandRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_command_request.rb' - autoload :SSISChildPackage, '2018-06-01/generated/azure_mgmt_data_factory/models/ssischild_package.rb' autoload :Resource, '2018-06-01/generated/azure_mgmt_data_factory/models/resource.rb' - autoload :ActivityDependency, '2018-06-01/generated/azure_mgmt_data_factory/models/activity_dependency.rb' - autoload :SubResourceDebugResource, '2018-06-01/generated/azure_mgmt_data_factory/models/sub_resource_debug_resource.rb' - autoload :Activity, '2018-06-01/generated/azure_mgmt_data_factory/models/activity.rb' - autoload :VariableSpecification, '2018-06-01/generated/azure_mgmt_data_factory/models/variable_specification.rb' - autoload :PipelineFolder, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_folder.rb' - autoload :RecurrenceSchedule, '2018-06-01/generated/azure_mgmt_data_factory/models/recurrence_schedule.rb' - autoload :PipelineListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_list_response.rb' - autoload :RecurrenceScheduleOccurrence, '2018-06-01/generated/azure_mgmt_data_factory/models/recurrence_schedule_occurrence.rb' - autoload :SSISPackageLocation, '2018-06-01/generated/azure_mgmt_data_factory/models/ssispackage_location.rb' - autoload :FactoryIdentity, '2018-06-01/generated/azure_mgmt_data_factory/models/factory_identity.rb' - autoload :TriggerListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_list_response.rb' - autoload :SSISAccessCredential, '2018-06-01/generated/azure_mgmt_data_factory/models/ssisaccess_credential.rb' - autoload :WebActivityAuthentication, '2018-06-01/generated/azure_mgmt_data_factory/models/web_activity_authentication.rb' autoload :SkipErrorFile, '2018-06-01/generated/azure_mgmt_data_factory/models/skip_error_file.rb' - autoload :Transformation, '2018-06-01/generated/azure_mgmt_data_factory/models/transformation.rb' - autoload :FactoryRepoUpdate, '2018-06-01/generated/azure_mgmt_data_factory/models/factory_repo_update.rb' - autoload :CustomActivityReferenceObject, '2018-06-01/generated/azure_mgmt_data_factory/models/custom_activity_reference_object.rb' - autoload :GitHubAccessTokenResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/git_hub_access_token_response.rb' - autoload :LogStorageSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/log_storage_settings.rb' - autoload :AccessPolicyResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/access_policy_response.rb' - autoload :CopySource, '2018-06-01/generated/azure_mgmt_data_factory/models/copy_source.rb' - autoload :TriggerPipelineReference, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_pipeline_reference.rb' - autoload :FormatReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/format_read_settings.rb' - autoload :DatasetReference, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_reference.rb' - autoload :StoreReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/store_read_settings.rb' - autoload :ExecuteDataFlowActivityTypePropertiesCompute, '2018-06-01/generated/azure_mgmt_data_factory/models/execute_data_flow_activity_type_properties_compute.rb' - autoload :AdditionalColumns, '2018-06-01/generated/azure_mgmt_data_factory/models/additional_columns.rb' - autoload :RunQueryFilter, '2018-06-01/generated/azure_mgmt_data_factory/models/run_query_filter.rb' - autoload :MongoDbCursorMethodsProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/mongo_db_cursor_methods_properties.rb' - autoload :RunFilterParameters, '2018-06-01/generated/azure_mgmt_data_factory/models/run_filter_parameters.rb' - autoload :SapHanaPartitionSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/sap_hana_partition_settings.rb' - autoload :PipelineRun, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_run.rb' - autoload :SapTablePartitionSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/sap_table_partition_settings.rb' - autoload :ActivityRun, '2018-06-01/generated/azure_mgmt_data_factory/models/activity_run.rb' - autoload :StoredProcedureParameter, '2018-06-01/generated/azure_mgmt_data_factory/models/stored_procedure_parameter.rb' - autoload :TriggerRun, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_run.rb' - autoload :ScriptAction, '2018-06-01/generated/azure_mgmt_data_factory/models/script_action.rb' - autoload :OperationDisplay, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_display.rb' - autoload :TeradataPartitionSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/teradata_partition_settings.rb' - autoload :OperationMetricAvailability, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_metric_availability.rb' - autoload :OraclePartitionSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/oracle_partition_settings.rb' - autoload :OperationMetricSpecification, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_metric_specification.rb' - autoload :NetezzaPartitionSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/netezza_partition_settings.rb' - autoload :Operation, '2018-06-01/generated/azure_mgmt_data_factory/models/operation.rb' - autoload :RedshiftUnloadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/redshift_unload_settings.rb' - autoload :GetSsisObjectMetadataRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/get_ssis_object_metadata_request.rb' - autoload :DistcpSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/distcp_settings.rb' - autoload :ExposureControlRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/exposure_control_request.rb' - autoload :SSISLogLocation, '2018-06-01/generated/azure_mgmt_data_factory/models/ssislog_location.rb' - autoload :DataFlowFolder, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_folder.rb' - autoload :AzureMLWebServiceFile, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_mlweb_service_file.rb' - autoload :ActivityPolicy, '2018-06-01/generated/azure_mgmt_data_factory/models/activity_policy.rb' - autoload :SSISPropertyOverride, '2018-06-01/generated/azure_mgmt_data_factory/models/ssisproperty_override.rb' - autoload :CreateDataFlowDebugSessionRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/create_data_flow_debug_session_request.rb' - autoload :DatasetStorageFormat, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_storage_format.rb' - autoload :IntegrationRuntimeListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_list_response.rb' - autoload :IntegrationRuntimeConnectionInfo, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_connection_info.rb' - autoload :IntegrationRuntimeStatusResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_status_response.rb' - autoload :IntegrationRuntimeRegenerateKeyParameters, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_regenerate_key_parameters.rb' - autoload :CreateLinkedIntegrationRuntimeRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/create_linked_integration_runtime_request.rb' - autoload :IntegrationRuntimeAuthKeys, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_auth_keys.rb' - autoload :LinkedServiceListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_service_list_response.rb' - autoload :IntegrationRuntimeMonitoringData, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_monitoring_data.rb' - autoload :DatasetListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_list_response.rb' - autoload :DatasetCompression, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_compression.rb' - autoload :WebLinkedServiceTypeProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/web_linked_service_type_properties.rb' - autoload :IntegrationRuntimeNodeMonitoringData, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_node_monitoring_data.rb' - autoload :TriggerQueryResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_query_response.rb' - autoload :SsisObjectMetadataListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_object_metadata_list_response.rb' - autoload :TriggerSubscriptionOperationStatus, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_subscription_operation_status.rb' - autoload :SsisObjectMetadata, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_object_metadata.rb' - autoload :GitHubAccessTokenRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/git_hub_access_token_request.rb' - autoload :SsisEnvironmentReference, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_environment_reference.rb' - autoload :PipelineReference, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_reference.rb' - autoload :SsisParameter, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_parameter.rb' - autoload :StagingSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/staging_settings.rb' - autoload :SsisVariable, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_variable.rb' - autoload :RunQueryOrderBy, '2018-06-01/generated/azure_mgmt_data_factory/models/run_query_order_by.rb' - autoload :IntegrationRuntimeNodeIpAddress, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_node_ip_address.rb' - autoload :PipelineRunsQueryResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_runs_query_response.rb' - autoload :IntegrationRuntimeComputeProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_compute_properties.rb' - autoload :TriggerRunsQueryResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_runs_query_response.rb' - autoload :IntegrationRuntimeDataFlowProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_data_flow_properties.rb' - autoload :OperationMetricDimension, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_metric_dimension.rb' - autoload :IntegrationRuntimeVNetProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_vnet_properties.rb' - autoload :OperationListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_list_response.rb' - autoload :IntegrationRuntimeSsisProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_properties.rb' - autoload :ExposureControlResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/exposure_control_response.rb' - autoload :IntegrationRuntimeSsisCatalogInfo, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_catalog_info.rb' - autoload :DataFlowListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_list_response.rb' - autoload :DatasetLocation, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_location.rb' - autoload :SSISExecutionParameter, '2018-06-01/generated/azure_mgmt_data_factory/models/ssisexecution_parameter.rb' - autoload :IntegrationRuntimeCustomSetupScriptProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_custom_setup_script_properties.rb' - autoload :LinkedService, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_service.rb' - autoload :IntegrationRuntimeDataProxyProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_data_proxy_properties.rb' - autoload :UserProperty, '2018-06-01/generated/azure_mgmt_data_factory/models/user_property.rb' - autoload :EntityReference, '2018-06-01/generated/azure_mgmt_data_factory/models/entity_reference.rb' - autoload :CreateRunResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/create_run_response.rb' - autoload :CustomSetupBase, '2018-06-01/generated/azure_mgmt_data_factory/models/custom_setup_base.rb' - autoload :UserAccessPolicy, '2018-06-01/generated/azure_mgmt_data_factory/models/user_access_policy.rb' - autoload :LinkedIntegrationRuntimeType, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_integration_runtime_type.rb' - autoload :TriggerFilterParameters, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_filter_parameters.rb' - autoload :ManagedIntegrationRuntimeNode, '2018-06-01/generated/azure_mgmt_data_factory/models/managed_integration_runtime_node.rb' - autoload :ActivityRunsQueryResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/activity_runs_query_response.rb' - autoload :ManagedIntegrationRuntimeError, '2018-06-01/generated/azure_mgmt_data_factory/models/managed_integration_runtime_error.rb' - autoload :OperationServiceSpecification, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_service_specification.rb' - autoload :ManagedIntegrationRuntimeOperationResult, '2018-06-01/generated/azure_mgmt_data_factory/models/managed_integration_runtime_operation_result.rb' - autoload :DataFlow, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow.rb' - autoload :SelfHostedIntegrationRuntimeNode, '2018-06-01/generated/azure_mgmt_data_factory/models/self_hosted_integration_runtime_node.rb' - autoload :UpdateIntegrationRuntimeNodeRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/update_integration_runtime_node_request.rb' - autoload :LinkedIntegrationRuntime, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_integration_runtime.rb' - autoload :Trigger, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger.rb' - autoload :TriggerReference, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_reference.rb' - autoload :FactoryUpdateParameters, '2018-06-01/generated/azure_mgmt_data_factory/models/factory_update_parameters.rb' - autoload :SwitchCase, '2018-06-01/generated/azure_mgmt_data_factory/models/switch_case.rb' - autoload :OperationLogSpecification, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_log_specification.rb' + autoload :SubResourceDebugResource, '2018-06-01/generated/azure_mgmt_data_factory/models/sub_resource_debug_resource.rb' + autoload :DataFlowDebugPackageDebugSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_package_debug_settings.rb' autoload :CopySink, '2018-06-01/generated/azure_mgmt_data_factory/models/copy_sink.rb' + autoload :DataFlowListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_list_response.rb' + autoload :AzureMLWebServiceFile, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_mlweb_service_file.rb' + autoload :CreateDataFlowDebugSessionRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/create_data_flow_debug_session_request.rb' + autoload :FactoryIdentity, '2018-06-01/generated/azure_mgmt_data_factory/models/factory_identity.rb' autoload :CreateDataFlowDebugSessionResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/create_data_flow_debug_session_response.rb' - autoload :DependencyReference, '2018-06-01/generated/azure_mgmt_data_factory/models/dependency_reference.rb' - autoload :RedirectIncompatibleRowSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/redirect_incompatible_row_settings.rb' - autoload :RetryPolicy, '2018-06-01/generated/azure_mgmt_data_factory/models/retry_policy.rb' - autoload :SsisObjectMetadataStatusResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_object_metadata_status_response.rb' - autoload :FormatWriteSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/format_write_settings.rb' - autoload :PipelineRunInvokedBy, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_run_invoked_by.rb' - autoload :StoreWriteSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/store_write_settings.rb' + autoload :GlobalParameterSpecification, '2018-06-01/generated/azure_mgmt_data_factory/models/global_parameter_specification.rb' + autoload :DataFlowSourceSetting, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_source_setting.rb' + autoload :FactoryListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/factory_list_response.rb' + autoload :SubResource, '2018-06-01/generated/azure_mgmt_data_factory/models/sub_resource.rb' + autoload :StagingSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/staging_settings.rb' + autoload :Expression, '2018-06-01/generated/azure_mgmt_data_factory/models/expression.rb' + autoload :IntegrationRuntimeReference, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_reference.rb' + autoload :SwitchCase, '2018-06-01/generated/azure_mgmt_data_factory/models/switch_case.rb' + autoload :IntegrationRuntimeStatus, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_status.rb' + autoload :DataFlowDebugPackage, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_package.rb' + autoload :IntegrationRuntimeStatusListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_status_list_response.rb' + autoload :AddDataFlowToDebugSessionResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/add_data_flow_to_debug_session_response.rb' + autoload :UpdateIntegrationRuntimeNodeRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/update_integration_runtime_node_request.rb' + autoload :DeleteDataFlowDebugSessionRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/delete_data_flow_debug_session_request.rb' + autoload :CreateLinkedIntegrationRuntimeRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/create_linked_integration_runtime_request.rb' + autoload :DataFlowDebugCommandPayload, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_command_payload.rb' + autoload :LinkedService, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_service.rb' + autoload :DataFlowDebugCommandRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_command_request.rb' + autoload :LinkedServiceListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_service_list_response.rb' + autoload :DataFlowDebugCommandResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_command_response.rb' autoload :Dataset, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset.rb' + autoload :DataFlowDebugSessionInfo, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_debug_session_info.rb' + autoload :DatasetListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_list_response.rb' + autoload :QueryDataFlowDebugSessionsResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/query_data_flow_debug_sessions_response.rb' + autoload :UserProperty, '2018-06-01/generated/azure_mgmt_data_factory/models/user_property.rb' + autoload :GetDataFactoryOperationStatusResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/get_data_factory_operation_status_response.rb' + autoload :VariableSpecification, '2018-06-01/generated/azure_mgmt_data_factory/models/variable_specification.rb' + autoload :DataFlowReference, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_reference.rb' + autoload :DWCopyCommandSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/dwcopy_command_settings.rb' + autoload :SSISPropertyOverride, '2018-06-01/generated/azure_mgmt_data_factory/models/ssisproperty_override.rb' + autoload :Trigger, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger.rb' + autoload :FormatReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/format_read_settings.rb' + autoload :TriggerQueryResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_query_response.rb' + autoload :Transformation, '2018-06-01/generated/azure_mgmt_data_factory/models/transformation.rb' + autoload :CreateRunResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/create_run_response.rb' + autoload :DistcpSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/distcp_settings.rb' + autoload :TriggerSubscriptionOperationStatus, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_subscription_operation_status.rb' + autoload :SSISLogLocation, '2018-06-01/generated/azure_mgmt_data_factory/models/ssislog_location.rb' + autoload :FormatWriteSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/format_write_settings.rb' + autoload :SSISAccessCredential, '2018-06-01/generated/azure_mgmt_data_factory/models/ssisaccess_credential.rb' + autoload :GitHubAccessTokenRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/git_hub_access_token_request.rb' + autoload :CustomActivityReferenceObject, '2018-06-01/generated/azure_mgmt_data_factory/models/custom_activity_reference_object.rb' + autoload :UserAccessPolicy, '2018-06-01/generated/azure_mgmt_data_factory/models/user_access_policy.rb' + autoload :LogStorageSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/log_storage_settings.rb' + autoload :PipelineReference, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_reference.rb' + autoload :CopySource, '2018-06-01/generated/azure_mgmt_data_factory/models/copy_source.rb' + autoload :FactoryUpdateParameters, '2018-06-01/generated/azure_mgmt_data_factory/models/factory_update_parameters.rb' + autoload :SapHanaPartitionSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/sap_hana_partition_settings.rb' + autoload :ExecuteDataFlowActivityTypePropertiesCompute, '2018-06-01/generated/azure_mgmt_data_factory/models/execute_data_flow_activity_type_properties_compute.rb' + autoload :SapTablePartitionSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/sap_table_partition_settings.rb' + autoload :TriggerFilterParameters, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_filter_parameters.rb' + autoload :StoredProcedureParameter, '2018-06-01/generated/azure_mgmt_data_factory/models/stored_procedure_parameter.rb' + autoload :RunQueryOrderBy, '2018-06-01/generated/azure_mgmt_data_factory/models/run_query_order_by.rb' + autoload :SqlPartitionSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/sql_partition_settings.rb' + autoload :PipelineRunInvokedBy, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_run_invoked_by.rb' + autoload :TeradataPartitionSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/teradata_partition_settings.rb' + autoload :PipelineRunsQueryResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_runs_query_response.rb' + autoload :NetezzaPartitionSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/netezza_partition_settings.rb' + autoload :ActivityRunsQueryResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/activity_runs_query_response.rb' + autoload :ScriptAction, '2018-06-01/generated/azure_mgmt_data_factory/models/script_action.rb' + autoload :TriggerRunsQueryResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_runs_query_response.rb' + autoload :StoreReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/store_read_settings.rb' + autoload :OperationLogSpecification, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_log_specification.rb' + autoload :RedshiftUnloadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/redshift_unload_settings.rb' + autoload :OperationMetricDimension, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_metric_dimension.rb' + autoload :WebActivityAuthentication, '2018-06-01/generated/azure_mgmt_data_factory/models/web_activity_authentication.rb' + autoload :OperationServiceSpecification, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_service_specification.rb' + autoload :OraclePartitionSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/oracle_partition_settings.rb' + autoload :OperationListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_list_response.rb' + autoload :MongoDbCursorMethodsProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/mongo_db_cursor_methods_properties.rb' + autoload :SsisObjectMetadataStatusResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_object_metadata_status_response.rb' + autoload :ExportSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/export_settings.rb' + autoload :ExposureControlResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/exposure_control_response.rb' + autoload :AdditionalColumns, '2018-06-01/generated/azure_mgmt_data_factory/models/additional_columns.rb' + autoload :DataFlow, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow.rb' + autoload :SSISExecutionParameter, '2018-06-01/generated/azure_mgmt_data_factory/models/ssisexecution_parameter.rb' + autoload :SecretBase, '2018-06-01/generated/azure_mgmt_data_factory/models/secret_base.rb' + autoload :SSISExecutionCredential, '2018-06-01/generated/azure_mgmt_data_factory/models/ssisexecution_credential.rb' + autoload :RedirectIncompatibleRowSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/redirect_incompatible_row_settings.rb' + autoload :SSISChildPackage, '2018-06-01/generated/azure_mgmt_data_factory/models/ssischild_package.rb' + autoload :IntegrationRuntimeListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_list_response.rb' + autoload :CompressionReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/compression_read_settings.rb' + autoload :IntegrationRuntimeStatusResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_status_response.rb' + autoload :SSISPackageLocation, '2018-06-01/generated/azure_mgmt_data_factory/models/ssispackage_location.rb' + autoload :LinkedIntegrationRuntimeRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_integration_runtime_request.rb' + autoload :IntegrationRuntimeConnectionInfo, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_connection_info.rb' + autoload :DWCopyCommandDefaultValue, '2018-06-01/generated/azure_mgmt_data_factory/models/dwcopy_command_default_value.rb' + autoload :IntegrationRuntimeRegenerateKeyParameters, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_regenerate_key_parameters.rb' + autoload :WebLinkedServiceTypeProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/web_linked_service_type_properties.rb' + autoload :IntegrationRuntimeAuthKeys, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_auth_keys.rb' + autoload :Activity, '2018-06-01/generated/azure_mgmt_data_factory/models/activity.rb' + autoload :IntegrationRuntimeMonitoringData, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_monitoring_data.rb' + autoload :PipelineListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_list_response.rb' + autoload :IntegrationRuntimeNodeMonitoringData, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_node_monitoring_data.rb' + autoload :TriggerListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_list_response.rb' + autoload :SsisObjectMetadataListResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_object_metadata_list_response.rb' + autoload :StoreWriteSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/store_write_settings.rb' + autoload :SsisObjectMetadata, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_object_metadata.rb' + autoload :GitHubAccessTokenResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/git_hub_access_token_response.rb' + autoload :DatasetStorageFormat, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_storage_format.rb' + autoload :TriggerPipelineReference, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_pipeline_reference.rb' + autoload :SsisEnvironmentReference, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_environment_reference.rb' + autoload :ActivityPolicy, '2018-06-01/generated/azure_mgmt_data_factory/models/activity_policy.rb' + autoload :SsisParameter, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_parameter.rb' + autoload :RunFilterParameters, '2018-06-01/generated/azure_mgmt_data_factory/models/run_filter_parameters.rb' + autoload :SsisVariable, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_variable.rb' + autoload :ActivityRun, '2018-06-01/generated/azure_mgmt_data_factory/models/activity_run.rb' + autoload :DatasetLocation, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_location.rb' + autoload :OperationDisplay, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_display.rb' + autoload :IntegrationRuntimeNodeIpAddress, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_node_ip_address.rb' + autoload :OperationMetricSpecification, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_metric_specification.rb' + autoload :DatasetCompression, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_compression.rb' + autoload :GetSsisObjectMetadataRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/get_ssis_object_metadata_request.rb' + autoload :IntegrationRuntimeComputeProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_compute_properties.rb' + autoload :DataFlowFolder, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_folder.rb' + autoload :IntegrationRuntimeDataFlowProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_data_flow_properties.rb' + autoload :FactoryRepoConfiguration, '2018-06-01/generated/azure_mgmt_data_factory/models/factory_repo_configuration.rb' + autoload :IntegrationRuntimeVNetProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_vnet_properties.rb' + autoload :ImportSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/import_settings.rb' + autoload :IntegrationRuntimeSsisProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_properties.rb' + autoload :ParameterSpecification, '2018-06-01/generated/azure_mgmt_data_factory/models/parameter_specification.rb' + autoload :IntegrationRuntimeSsisCatalogInfo, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_catalog_info.rb' + autoload :ActivityDependency, '2018-06-01/generated/azure_mgmt_data_factory/models/activity_dependency.rb' + autoload :IntegrationRuntimeCustomSetupScriptProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_custom_setup_script_properties.rb' autoload :PolybaseSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/polybase_settings.rb' + autoload :IntegrationRuntimeDataProxyProperties, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_data_proxy_properties.rb' + autoload :FactoryRepoUpdate, '2018-06-01/generated/azure_mgmt_data_factory/models/factory_repo_update.rb' + autoload :CustomSetupBase, '2018-06-01/generated/azure_mgmt_data_factory/models/custom_setup_base.rb' + autoload :DatasetReference, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_reference.rb' + autoload :PackageStore, '2018-06-01/generated/azure_mgmt_data_factory/models/package_store.rb' + autoload :PipelineRun, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_run.rb' + autoload :EntityReference, '2018-06-01/generated/azure_mgmt_data_factory/models/entity_reference.rb' + autoload :OperationMetricAvailability, '2018-06-01/generated/azure_mgmt_data_factory/models/operation_metric_availability.rb' + autoload :LinkedIntegrationRuntimeType, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_integration_runtime_type.rb' + autoload :ExposureControlRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/exposure_control_request.rb' + autoload :TriggerReference, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_reference.rb' + autoload :IntegrationRuntime, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime.rb' + autoload :ManagedIntegrationRuntimeNode, '2018-06-01/generated/azure_mgmt_data_factory/models/managed_integration_runtime_node.rb' + autoload :DatasetFolder, '2018-06-01/generated/azure_mgmt_data_factory/models/dataset_folder.rb' + autoload :ManagedIntegrationRuntimeError, '2018-06-01/generated/azure_mgmt_data_factory/models/managed_integration_runtime_error.rb' + autoload :DependencyReference, '2018-06-01/generated/azure_mgmt_data_factory/models/dependency_reference.rb' + autoload :RunQueryFilter, '2018-06-01/generated/azure_mgmt_data_factory/models/run_query_filter.rb' + autoload :RetryPolicy, '2018-06-01/generated/azure_mgmt_data_factory/models/retry_policy.rb' + autoload :Operation, '2018-06-01/generated/azure_mgmt_data_factory/models/operation.rb' + autoload :ManagedIntegrationRuntimeOperationResult, '2018-06-01/generated/azure_mgmt_data_factory/models/managed_integration_runtime_operation_result.rb' + autoload :UpdateIntegrationRuntimeRequest, '2018-06-01/generated/azure_mgmt_data_factory/models/update_integration_runtime_request.rb' + autoload :SelfHostedIntegrationRuntimeNode, '2018-06-01/generated/azure_mgmt_data_factory/models/self_hosted_integration_runtime_node.rb' + autoload :AccessPolicyResponse, '2018-06-01/generated/azure_mgmt_data_factory/models/access_policy_response.rb' + autoload :LinkedIntegrationRuntime, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_integration_runtime.rb' + autoload :LinkedServiceReference, '2018-06-01/generated/azure_mgmt_data_factory/models/linked_service_reference.rb' + autoload :RecurrenceScheduleOccurrence, '2018-06-01/generated/azure_mgmt_data_factory/models/recurrence_schedule_occurrence.rb' + autoload :TriggerRun, '2018-06-01/generated/azure_mgmt_data_factory/models/trigger_run.rb' + autoload :RecurrenceSchedule, '2018-06-01/generated/azure_mgmt_data_factory/models/recurrence_schedule.rb' + autoload :PipelineFolder, '2018-06-01/generated/azure_mgmt_data_factory/models/pipeline_folder.rb' + autoload :ScheduleTriggerRecurrence, '2018-06-01/generated/azure_mgmt_data_factory/models/schedule_trigger_recurrence.rb' autoload :SecureString, '2018-06-01/generated/azure_mgmt_data_factory/models/secure_string.rb' autoload :AzureKeyVaultSecretReference, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_key_vault_secret_reference.rb' autoload :Factory, '2018-06-01/generated/azure_mgmt_data_factory/models/factory.rb' @@ -216,6 +222,8 @@ module Azure::DataFactory::Mgmt::V2018_06_01 autoload :DataFlowSink, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_sink.rb' autoload :DataFlowSource, '2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_source.rb' autoload :MappingDataFlow, '2018-06-01/generated/azure_mgmt_data_factory/models/mapping_data_flow.rb' + autoload :SharePointOnlineListLinkedService, '2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_linked_service.rb' + autoload :SnowflakeLinkedService, '2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_linked_service.rb' autoload :AzureFunctionLinkedService, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_function_linked_service.rb' autoload :AzureDataExplorerLinkedService, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_explorer_linked_service.rb' autoload :SapTableLinkedService, '2018-06-01/generated/azure_mgmt_data_factory/models/sap_table_linked_service.rb' @@ -313,6 +321,8 @@ module Azure::DataFactory::Mgmt::V2018_06_01 autoload :AzureTableStorageLinkedService, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_table_storage_linked_service.rb' autoload :AzureBlobStorageLinkedService, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_storage_linked_service.rb' autoload :AzureStorageLinkedService, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_storage_linked_service.rb' + autoload :SharePointOnlineListResourceDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_resource_dataset.rb' + autoload :SnowflakeDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_dataset.rb' autoload :GoogleAdWordsObjectDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/google_ad_words_object_dataset.rb' autoload :AzureDataExplorerTableDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_explorer_table_dataset.rb' autoload :OracleServiceCloudObjectDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/oracle_service_cloud_object_dataset.rb' @@ -415,9 +425,11 @@ module Azure::DataFactory::Mgmt::V2018_06_01 autoload :AzureBlobStorageLocation, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_storage_location.rb' autoload :BinaryDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/binary_dataset.rb' autoload :OrcDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/orc_dataset.rb' + autoload :XmlDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/xml_dataset.rb' autoload :JsonDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/json_dataset.rb' autoload :DelimitedTextDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/delimited_text_dataset.rb' autoload :ParquetDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/parquet_dataset.rb' + autoload :ExcelDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/excel_dataset.rb' autoload :AvroDataset, '2018-06-01/generated/azure_mgmt_data_factory/models/avro_dataset.rb' autoload :AmazonS3Dataset, '2018-06-01/generated/azure_mgmt_data_factory/models/amazon_s3dataset.rb' autoload :ChainingTrigger, '2018-06-01/generated/azure_mgmt_data_factory/models/chaining_trigger.rb' @@ -430,7 +442,6 @@ module Azure::DataFactory::Mgmt::V2018_06_01 autoload :BlobEventsTrigger, '2018-06-01/generated/azure_mgmt_data_factory/models/blob_events_trigger.rb' autoload :BlobTrigger, '2018-06-01/generated/azure_mgmt_data_factory/models/blob_trigger.rb' autoload :ScheduleTrigger, '2018-06-01/generated/azure_mgmt_data_factory/models/schedule_trigger.rb' - autoload :ExecutionActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/execution_activity.rb' autoload :ExecuteDataFlowActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/execute_data_flow_activity.rb' autoload :AzureFunctionActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_function_activity.rb' autoload :DatabricksSparkPythonActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/databricks_spark_python_activity.rb' @@ -440,8 +451,27 @@ module Azure::DataFactory::Mgmt::V2018_06_01 autoload :AzureMLExecutePipelineActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_mlexecute_pipeline_activity.rb' autoload :AzureMLUpdateResourceActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_mlupdate_resource_activity.rb' autoload :AzureMLBatchExecutionActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_mlbatch_execution_activity.rb' + autoload :ZipDeflateReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/zip_deflate_read_settings.rb' + autoload :BinaryReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/binary_read_settings.rb' + autoload :XmlReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/xml_read_settings.rb' + autoload :JsonReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/json_read_settings.rb' + autoload :DelimitedTextReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/delimited_text_read_settings.rb' + autoload :HdfsReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/hdfs_read_settings.rb' + autoload :HttpReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/http_read_settings.rb' + autoload :SftpReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/sftp_read_settings.rb' + autoload :FtpReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/ftp_read_settings.rb' + autoload :GoogleCloudStorageReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/google_cloud_storage_read_settings.rb' + autoload :AzureFileStorageReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_read_settings.rb' + autoload :FileServerReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/file_server_read_settings.rb' + autoload :AmazonS3ReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/amazon_s3read_settings.rb' + autoload :AzureDataLakeStoreReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_lake_store_read_settings.rb' + autoload :AzureBlobFSReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_fsread_settings.rb' + autoload :AzureBlobStorageReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_storage_read_settings.rb' autoload :GetMetadataActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/get_metadata_activity.rb' autoload :WebActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/web_activity.rb' + autoload :SharePointOnlineListSource, '2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_source.rb' + autoload :SnowflakeExportCopyCommand, '2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_export_copy_command.rb' + autoload :SnowflakeSource, '2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_source.rb' autoload :HttpSource, '2018-06-01/generated/azure_mgmt_data_factory/models/http_source.rb' autoload :AzureBlobFSSource, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_fssource.rb' autoload :AzureDataLakeStoreSource, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_lake_store_source.rb' @@ -523,23 +553,13 @@ module Azure::DataFactory::Mgmt::V2018_06_01 autoload :Db2Source, '2018-06-01/generated/azure_mgmt_data_factory/models/db2source.rb' autoload :InformixSource, '2018-06-01/generated/azure_mgmt_data_factory/models/informix_source.rb' autoload :AzureTableSource, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_table_source.rb' - autoload :HdfsReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/hdfs_read_settings.rb' - autoload :HttpReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/http_read_settings.rb' - autoload :SftpReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/sftp_read_settings.rb' - autoload :FtpReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/ftp_read_settings.rb' - autoload :GoogleCloudStorageReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/google_cloud_storage_read_settings.rb' - autoload :AzureFileStorageReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_read_settings.rb' - autoload :FileServerReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/file_server_read_settings.rb' - autoload :AmazonS3ReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/amazon_s3read_settings.rb' - autoload :AzureDataLakeStoreReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_lake_store_read_settings.rb' - autoload :AzureBlobFSReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_fsread_settings.rb' - autoload :AzureBlobStorageReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_storage_read_settings.rb' autoload :BinarySource, '2018-06-01/generated/azure_mgmt_data_factory/models/binary_source.rb' autoload :OrcSource, '2018-06-01/generated/azure_mgmt_data_factory/models/orc_source.rb' + autoload :XmlSource, '2018-06-01/generated/azure_mgmt_data_factory/models/xml_source.rb' autoload :JsonSource, '2018-06-01/generated/azure_mgmt_data_factory/models/json_source.rb' - autoload :DelimitedTextReadSettings, '2018-06-01/generated/azure_mgmt_data_factory/models/delimited_text_read_settings.rb' autoload :DelimitedTextSource, '2018-06-01/generated/azure_mgmt_data_factory/models/delimited_text_source.rb' autoload :ParquetSource, '2018-06-01/generated/azure_mgmt_data_factory/models/parquet_source.rb' + autoload :ExcelSource, '2018-06-01/generated/azure_mgmt_data_factory/models/excel_source.rb' autoload :AvroSource, '2018-06-01/generated/azure_mgmt_data_factory/models/avro_source.rb' autoload :LookupActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/lookup_activity.rb' autoload :AzureDataExplorerCommandActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_explorer_command_activity.rb' @@ -566,6 +586,8 @@ module Azure::DataFactory::Mgmt::V2018_06_01 autoload :AzureBlobFSSink, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_fssink.rb' autoload :AzureDataLakeStoreSink, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_lake_store_sink.rb' autoload :OracleSink, '2018-06-01/generated/azure_mgmt_data_factory/models/oracle_sink.rb' + autoload :SnowflakeImportCopyCommand, '2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_import_copy_command.rb' + autoload :SnowflakeSink, '2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_sink.rb' autoload :SqlDWSink, '2018-06-01/generated/azure_mgmt_data_factory/models/sql_dwsink.rb' autoload :SqlMISink, '2018-06-01/generated/azure_mgmt_data_factory/models/sql_misink.rb' autoload :AzureSqlSink, '2018-06-01/generated/azure_mgmt_data_factory/models/azure_sql_sink.rb' @@ -594,6 +616,7 @@ module Azure::DataFactory::Mgmt::V2018_06_01 autoload :OrcSink, '2018-06-01/generated/azure_mgmt_data_factory/models/orc_sink.rb' autoload :JsonSink, '2018-06-01/generated/azure_mgmt_data_factory/models/json_sink.rb' autoload :DelimitedTextSink, '2018-06-01/generated/azure_mgmt_data_factory/models/delimited_text_sink.rb' + autoload :ExecutionActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/execution_activity.rb' autoload :CopyActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/copy_activity.rb' autoload :ControlActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/control_activity.rb' autoload :WebHookActivity, '2018-06-01/generated/azure_mgmt_data_factory/models/web_hook_activity.rb' @@ -620,6 +643,7 @@ module Azure::DataFactory::Mgmt::V2018_06_01 autoload :SsisPackage, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_package.rb' autoload :SsisProject, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_project.rb' autoload :SsisFolder, '2018-06-01/generated/azure_mgmt_data_factory/models/ssis_folder.rb' + autoload :GlobalParameterType, '2018-06-01/generated/azure_mgmt_data_factory/models/global_parameter_type.rb' autoload :IntegrationRuntimeState, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_state.rb' autoload :IntegrationRuntimeAutoUpdate, '2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_auto_update.rb' autoload :ParameterType, '2018-06-01/generated/azure_mgmt_data_factory/models/parameter_type.rb' @@ -674,6 +698,7 @@ module Azure::DataFactory::Mgmt::V2018_06_01 autoload :NetezzaPartitionOption, '2018-06-01/generated/azure_mgmt_data_factory/models/netezza_partition_option.rb' autoload :CassandraSourceReadConsistencyLevels, '2018-06-01/generated/azure_mgmt_data_factory/models/cassandra_source_read_consistency_levels.rb' autoload :TeradataPartitionOption, '2018-06-01/generated/azure_mgmt_data_factory/models/teradata_partition_option.rb' + autoload :SqlPartitionOption, '2018-06-01/generated/azure_mgmt_data_factory/models/sql_partition_option.rb' autoload :StoredProcedureParameterType, '2018-06-01/generated/azure_mgmt_data_factory/models/stored_procedure_parameter_type.rb' autoload :SapTablePartitionOption, '2018-06-01/generated/azure_mgmt_data_factory/models/sap_table_partition_option.rb' autoload :SapHanaPartitionOption, '2018-06-01/generated/azure_mgmt_data_factory/models/sap_hana_partition_option.rb' diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/data_factory_management_client.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/data_factory_management_client.rb index 57bccad54..df68f4e9a 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/data_factory_management_client.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/data_factory_management_client.rb @@ -181,7 +181,7 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # def add_telemetry sdk_information = 'azure_mgmt_data_factory' - sdk_information = "#{sdk_information}/0.18.2" + sdk_information = "#{sdk_information}/0.18.3" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/amazon_s3read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/amazon_s3read_settings.rb index 87ccff992..f062cebbb 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/amazon_s3read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/amazon_s3read_settings.rb @@ -43,6 +43,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [Boolean] Indicates whether to enable partition discovery. attr_accessor :enable_partition_discovery + # @return Specify the root path where partition discovery starts from. + # Type: string (or Expression with resultType string). + attr_accessor :partition_root_path + + # @return Indicates whether the source files need to be deleted after + # copy completion. Default is false. Type: boolean (or Expression with + # resultType boolean). + attr_accessor :delete_files_after_completion + # @return The start of file's modified datetime. Type: string (or # Expression with resultType string). attr_accessor :modified_datetime_start @@ -144,6 +153,22 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Boolean' } }, + partition_root_path: { + client_side_validation: true, + required: false, + serialized_name: 'partitionRootPath', + type: { + name: 'Object' + } + }, + delete_files_after_completion: { + client_side_validation: true, + required: false, + serialized_name: 'deleteFilesAfterCompletion', + type: { + name: 'Object' + } + }, modified_datetime_start: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_fsread_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_fsread_settings.rb index 7a2d82ea5..907e0ff4c 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_fsread_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_fsread_settings.rb @@ -39,6 +39,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [Boolean] Indicates whether to enable partition discovery. attr_accessor :enable_partition_discovery + # @return Specify the root path where partition discovery starts from. + # Type: string (or Expression with resultType string). + attr_accessor :partition_root_path + + # @return Indicates whether the source files need to be deleted after + # copy completion. Default is false. Type: boolean (or Expression with + # resultType boolean). + attr_accessor :delete_files_after_completion + # @return The start of file's modified datetime. Type: string (or # Expression with resultType string). attr_accessor :modified_datetime_start @@ -132,6 +141,22 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Boolean' } }, + partition_root_path: { + client_side_validation: true, + required: false, + serialized_name: 'partitionRootPath', + type: { + name: 'Object' + } + }, + delete_files_after_completion: { + client_side_validation: true, + required: false, + serialized_name: 'deleteFilesAfterCompletion', + type: { + name: 'Object' + } + }, modified_datetime_start: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_storage_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_storage_read_settings.rb index f96b8612e..ad076847e 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_storage_read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_storage_read_settings.rb @@ -43,6 +43,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [Boolean] Indicates whether to enable partition discovery. attr_accessor :enable_partition_discovery + # @return Specify the root path where partition discovery starts from. + # Type: string (or Expression with resultType string). + attr_accessor :partition_root_path + + # @return Indicates whether the source files need to be deleted after + # copy completion. Default is false. Type: boolean (or Expression with + # resultType boolean). + attr_accessor :delete_files_after_completion + # @return The start of file's modified datetime. Type: string (or # Expression with resultType string). attr_accessor :modified_datetime_start @@ -144,6 +153,22 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Boolean' } }, + partition_root_path: { + client_side_validation: true, + required: false, + serialized_name: 'partitionRootPath', + type: { + name: 'Object' + } + }, + delete_files_after_completion: { + client_side_validation: true, + required: false, + serialized_name: 'deleteFilesAfterCompletion', + type: { + name: 'Object' + } + }, modified_datetime_start: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_lake_store_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_lake_store_read_settings.rb index f07592650..88c84ea04 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_lake_store_read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_lake_store_read_settings.rb @@ -36,9 +36,30 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # Expression with resultType string). attr_accessor :file_list_path + # @return Lists files after the value (exclusive) based on file/folder + # names’ lexicographical order. Applies under the folderPath in data set, + # and filter files/sub-folders under the folderPath. Type: string (or + # Expression with resultType string). + attr_accessor :list_after + + # @return Lists files before the value (inclusive) based on file/folder + # names’ lexicographical order. Applies under the folderPath in data set, + # and filter files/sub-folders under the folderPath. Type: string (or + # Expression with resultType string). + attr_accessor :list_before + # @return [Boolean] Indicates whether to enable partition discovery. attr_accessor :enable_partition_discovery + # @return Specify the root path where partition discovery starts from. + # Type: string (or Expression with resultType string). + attr_accessor :partition_root_path + + # @return Indicates whether the source files need to be deleted after + # copy completion. Default is false. Type: boolean (or Expression with + # resultType boolean). + attr_accessor :delete_files_after_completion + # @return The start of file's modified datetime. Type: string (or # Expression with resultType string). attr_accessor :modified_datetime_start @@ -124,6 +145,22 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Object' } }, + list_after: { + client_side_validation: true, + required: false, + serialized_name: 'listAfter', + type: { + name: 'Object' + } + }, + list_before: { + client_side_validation: true, + required: false, + serialized_name: 'listBefore', + type: { + name: 'Object' + } + }, enable_partition_discovery: { client_side_validation: true, required: false, @@ -132,6 +169,22 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Boolean' } }, + partition_root_path: { + client_side_validation: true, + required: false, + serialized_name: 'partitionRootPath', + type: { + name: 'Object' + } + }, + delete_files_after_completion: { + client_side_validation: true, + required: false, + serialized_name: 'deleteFilesAfterCompletion', + type: { + name: 'Object' + } + }, modified_datetime_start: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_linked_service.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_linked_service.rb index d02a21d60..12cfc7fac 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_linked_service.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_linked_service.rb @@ -30,6 +30,28 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [SecretBase] Password to logon the server. attr_accessor :password + # @return The connection string. It is mutually exclusive with sasUri + # property. Type: string, SecureString or AzureKeyVaultSecretReference. + attr_accessor :connection_string + + # @return [AzureKeyVaultSecretReference] The Azure key vault secret + # reference of accountKey in connection string. + attr_accessor :account_key + + # @return SAS URI of the Azure File resource. It is mutually exclusive + # with connectionString property. Type: string, SecureString or + # AzureKeyVaultSecretReference. + attr_accessor :sas_uri + + # @return [AzureKeyVaultSecretReference] The Azure key vault secret + # reference of sasToken in sas uri. + attr_accessor :sas_token + + # @return The azure file share name. It is required when auth with + # accountKey/sasToken. Type: string (or Expression with resultType + # string). + attr_accessor :file_share + # @return The encrypted credential used for authentication. Credentials # are encrypted using the integration runtime credential manager. Type: # string (or Expression with resultType string). @@ -124,7 +146,7 @@ module Azure::DataFactory::Mgmt::V2018_06_01 }, host: { client_side_validation: true, - required: true, + required: false, serialized_name: 'typeProperties.host', type: { name: 'Object' @@ -149,6 +171,48 @@ module Azure::DataFactory::Mgmt::V2018_06_01 class_name: 'SecretBase' } }, + connection_string: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.connectionString', + type: { + name: 'Object' + } + }, + account_key: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.accountKey', + type: { + name: 'Composite', + class_name: 'AzureKeyVaultSecretReference' + } + }, + sas_uri: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.sasUri', + type: { + name: 'Object' + } + }, + sas_token: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.sasToken', + type: { + name: 'Composite', + class_name: 'AzureKeyVaultSecretReference' + } + }, + file_share: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.fileShare', + type: { + name: 'Object' + } + }, encrypted_credential: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_read_settings.rb index a54837bfc..55401d5ef 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_read_settings.rb @@ -31,6 +31,10 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # Expression with resultType string). attr_accessor :wildcard_file_name + # @return The prefix filter for the Azure File name starting from root + # path. Type: string (or Expression with resultType string). + attr_accessor :prefix + # @return Point to a text file that lists each file (relative path to the # path configured in the dataset) that you want to copy. Type: string (or # Expression with resultType string). @@ -39,6 +43,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [Boolean] Indicates whether to enable partition discovery. attr_accessor :enable_partition_discovery + # @return Specify the root path where partition discovery starts from. + # Type: string (or Expression with resultType string). + attr_accessor :partition_root_path + + # @return Indicates whether the source files need to be deleted after + # copy completion. Default is false. Type: boolean (or Expression with + # resultType boolean). + attr_accessor :delete_files_after_completion + # @return The start of file's modified datetime. Type: string (or # Expression with resultType string). attr_accessor :modified_datetime_start @@ -116,6 +129,14 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Object' } }, + prefix: { + client_side_validation: true, + required: false, + serialized_name: 'prefix', + type: { + name: 'Object' + } + }, file_list_path: { client_side_validation: true, required: false, @@ -132,6 +153,22 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Boolean' } }, + partition_root_path: { + client_side_validation: true, + required: false, + serialized_name: 'partitionRootPath', + type: { + name: 'Object' + } + }, + delete_files_after_completion: { + client_side_validation: true, + required: false, + serialized_name: 'deleteFilesAfterCompletion', + type: { + name: 'Object' + } + }, modified_datetime_start: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_sql_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_sql_source.rb index 50235106e..af3b5fbba 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_sql_source.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_sql_source.rb @@ -36,6 +36,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return Which additional types to produce. attr_accessor :produce_additional_types + # @return [SqlPartitionOption] The partition mechanism that will be used + # for Sql read in parallel. Possible values include: 'None', + # 'PhysicalPartitionsOfTable', 'DynamicRange' + attr_accessor :partition_option + + # @return [SqlPartitionSettings] The settings that will be leveraged for + # Sql source partitioning. + attr_accessor :partition_settings + # # Mapper for AzureSqlSource class as Ruby Hash. @@ -162,6 +171,23 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'Object' } + }, + partition_option: { + client_side_validation: true, + required: false, + serialized_name: 'partitionOption', + type: { + name: 'String' + } + }, + partition_settings: { + client_side_validation: true, + required: false, + serialized_name: 'partitionSettings', + type: { + name: 'Composite', + class_name: 'SqlPartitionSettings' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/binary_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/binary_read_settings.rb new file mode 100644 index 000000000..bef8d1fff --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/binary_read_settings.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Binary read settings. + # + class BinaryReadSettings < FormatReadSettings + + include MsRestAzure + + + def initialize + @type = "BinaryReadSettings" + end + + attr_accessor :type + + # @return [CompressionReadSettings] Compression settings. + attr_accessor :compression_properties + + + # + # Mapper for BinaryReadSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'BinaryReadSettings', + type: { + name: 'Composite', + class_name: 'BinaryReadSettings', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + compression_properties: { + client_side_validation: true, + required: false, + serialized_name: 'compressionProperties', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'CompressionReadSettings', + class_name: 'CompressionReadSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/binary_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/binary_source.rb index 07ef0382b..b927e0d1e 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/binary_source.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/binary_source.rb @@ -22,6 +22,9 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [StoreReadSettings] Binary store settings. attr_accessor :store_settings + # @return [BinaryReadSettings] Binary format settings. + attr_accessor :format_settings + # # Mapper for BinarySource class as Ruby Hash. @@ -93,6 +96,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 uber_parent: 'StoreReadSettings', class_name: 'StoreReadSettings' } + }, + format_settings: { + client_side_validation: true, + required: false, + serialized_name: 'formatSettings', + type: { + name: 'Composite', + class_name: 'BinaryReadSettings' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/compression_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/compression_read_settings.rb new file mode 100644 index 000000000..ac7968355 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/compression_read_settings.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Compression read settings. + # + class CompressionReadSettings + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["ZipDeflateReadSettings"] = "ZipDeflateReadSettings" + + def initialize + @type = "CompressionReadSettings" + end + + attr_accessor :type + + # @return Unmatched properties from the message are deserialized this + # collection + attr_accessor :additional_properties + + + # + # Mapper for CompressionReadSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CompressionReadSettings', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'CompressionReadSettings', + class_name: 'CompressionReadSettings', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/copy_sink.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/copy_sink.rb index 82c1c775c..23ba1c537 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/copy_sink.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/copy_sink.rb @@ -27,6 +27,7 @@ module Azure::DataFactory::Mgmt::V2018_06_01 @@discriminatorMap["AzureBlobFSSink"] = "AzureBlobFSSink" @@discriminatorMap["AzureDataLakeStoreSink"] = "AzureDataLakeStoreSink" @@discriminatorMap["OracleSink"] = "OracleSink" + @@discriminatorMap["SnowflakeSink"] = "SnowflakeSink" @@discriminatorMap["SqlDWSink"] = "SqlDWSink" @@discriminatorMap["SqlMISink"] = "SqlMISink" @@discriminatorMap["AzureSqlSink"] = "AzureSqlSink" diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/copy_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/copy_source.rb index e9787bf51..ecd9749ca 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/copy_source.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/copy_source.rb @@ -13,6 +13,8 @@ module Azure::DataFactory::Mgmt::V2018_06_01 include MsRestAzure @@discriminatorMap = Hash.new + @@discriminatorMap["SharePointOnlineListSource"] = "SharePointOnlineListSource" + @@discriminatorMap["SnowflakeSource"] = "SnowflakeSource" @@discriminatorMap["HttpSource"] = "HttpSource" @@discriminatorMap["AzureBlobFSSource"] = "AzureBlobFSSource" @@discriminatorMap["AzureDataLakeStoreSource"] = "AzureDataLakeStoreSource" @@ -96,9 +98,11 @@ module Azure::DataFactory::Mgmt::V2018_06_01 @@discriminatorMap["TabularSource"] = "TabularSource" @@discriminatorMap["BinarySource"] = "BinarySource" @@discriminatorMap["OrcSource"] = "OrcSource" + @@discriminatorMap["XmlSource"] = "XmlSource" @@discriminatorMap["JsonSource"] = "JsonSource" @@discriminatorMap["DelimitedTextSource"] = "DelimitedTextSource" @@discriminatorMap["ParquetSource"] = "ParquetSource" + @@discriminatorMap["ExcelSource"] = "ExcelSource" @@discriminatorMap["AvroSource"] = "AvroSource" def initialize diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_sink.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_sink.rb index 6976eecea..ac3ba80a2 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_sink.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_sink.rb @@ -15,6 +15,12 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [DatasetReference] Dataset reference. attr_accessor :dataset + # @return [LinkedServiceReference] Linked service reference. + attr_accessor :linked_service + + # @return [LinkedServiceReference] Schema linked service reference. + attr_accessor :schema_linked_service + # # Mapper for DataFlowSink class as Ruby Hash. @@ -53,6 +59,24 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Composite', class_name: 'DatasetReference' } + }, + linked_service: { + client_side_validation: true, + required: false, + serialized_name: 'linkedService', + type: { + name: 'Composite', + class_name: 'LinkedServiceReference' + } + }, + schema_linked_service: { + client_side_validation: true, + required: false, + serialized_name: 'schemaLinkedService', + type: { + name: 'Composite', + class_name: 'LinkedServiceReference' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_source.rb index cfffc289f..a072f882d 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_source.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_source.rb @@ -15,6 +15,12 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [DatasetReference] Dataset reference. attr_accessor :dataset + # @return [LinkedServiceReference] Linked service reference. + attr_accessor :linked_service + + # @return [LinkedServiceReference] Schema linked service reference. + attr_accessor :schema_linked_service + # # Mapper for DataFlowSource class as Ruby Hash. @@ -53,6 +59,24 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Composite', class_name: 'DatasetReference' } + }, + linked_service: { + client_side_validation: true, + required: false, + serialized_name: 'linkedService', + type: { + name: 'Composite', + class_name: 'LinkedServiceReference' + } + }, + schema_linked_service: { + client_side_validation: true, + required: false, + serialized_name: 'schemaLinkedService', + type: { + name: 'Composite', + class_name: 'LinkedServiceReference' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/dataset.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/dataset.rb index 5b04c824d..f6633f9ea 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/dataset.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/dataset.rb @@ -14,6 +14,8 @@ module Azure::DataFactory::Mgmt::V2018_06_01 include MsRestAzure @@discriminatorMap = Hash.new + @@discriminatorMap["SharePointOnlineListResource"] = "SharePointOnlineListResourceDataset" + @@discriminatorMap["SnowflakeTable"] = "SnowflakeDataset" @@discriminatorMap["GoogleAdWordsObject"] = "GoogleAdWordsObjectDataset" @@discriminatorMap["AzureDataExplorerTable"] = "AzureDataExplorerTableDataset" @@discriminatorMap["OracleServiceCloudObject"] = "OracleServiceCloudObjectDataset" @@ -96,9 +98,11 @@ module Azure::DataFactory::Mgmt::V2018_06_01 @@discriminatorMap["AzureBlob"] = "AzureBlobDataset" @@discriminatorMap["Binary"] = "BinaryDataset" @@discriminatorMap["Orc"] = "OrcDataset" + @@discriminatorMap["Xml"] = "XmlDataset" @@discriminatorMap["Json"] = "JsonDataset" @@discriminatorMap["DelimitedText"] = "DelimitedTextDataset" @@discriminatorMap["Parquet"] = "ParquetDataset" + @@discriminatorMap["Excel"] = "ExcelDataset" @@discriminatorMap["Avro"] = "AvroDataset" @@discriminatorMap["AmazonS3Object"] = "AmazonS3Dataset" diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/delete_activity.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/delete_activity.rb index ff033ee79..0c737f68f 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/delete_activity.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/delete_activity.rb @@ -40,6 +40,9 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [DatasetReference] Delete activity dataset reference. attr_accessor :dataset + # @return [StoreReadSettings] Delete activity store settings. + attr_accessor :store_settings + # # Mapper for DeleteActivity class as Ruby Hash. @@ -190,6 +193,17 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Composite', class_name: 'DatasetReference' } + }, + store_settings: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.storeSettings', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'StoreReadSettings', + class_name: 'StoreReadSettings' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/delimited_text_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/delimited_text_read_settings.rb index 432f012a4..d4b7fa2e6 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/delimited_text_read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/delimited_text_read_settings.rb @@ -24,6 +24,9 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # integer). attr_accessor :skip_line_count + # @return [CompressionReadSettings] Compression settings. + attr_accessor :compression_properties + # # Mapper for DelimitedTextReadSettings class as Ruby Hash. @@ -68,6 +71,17 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'Object' } + }, + compression_properties: { + client_side_validation: true, + required: false, + serialized_name: 'compressionProperties', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'CompressionReadSettings', + class_name: 'CompressionReadSettings' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/dynamics_axsource.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/dynamics_axsource.rb index e1cb3b913..1f354548d 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/dynamics_axsource.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/dynamics_axsource.rb @@ -23,6 +23,12 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # Expression with resultType string). attr_accessor :query + # @return The timeout (TimeSpan) to get an HTTP response. It is the + # timeout to get a response, not the timeout to read response data. + # Default value: 00:05:00. Type: string (or Expression with resultType + # string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + attr_accessor :http_request_timeout + # # Mapper for DynamicsAXSource class as Ruby Hash. @@ -116,6 +122,14 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'Object' } + }, + http_request_timeout: { + client_side_validation: true, + required: false, + serialized_name: 'httpRequestTimeout', + type: { + name: 'Object' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/excel_dataset.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/excel_dataset.rb new file mode 100644 index 000000000..20741a986 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/excel_dataset.rb @@ -0,0 +1,220 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Excel dataset. + # + class ExcelDataset < Dataset + + include MsRestAzure + + + def initialize + @type = "Excel" + end + + attr_accessor :type + + # @return [DatasetLocation] The location of the excel storage. + attr_accessor :location + + # @return The sheet of excel file. Type: string (or Expression with + # resultType string). + attr_accessor :sheet_name + + # @return The partial data of one sheet. Type: string (or Expression with + # resultType string). + attr_accessor :range + + # @return When used as input, treat the first row of data as headers. + # When used as output,write the headers into the output as the first row + # of data. The default value is false. Type: boolean (or Expression with + # resultType boolean). + attr_accessor :first_row_as_header + + # @return [DatasetCompression] The data compression method used for the + # json dataset. + attr_accessor :compression + + # @return The null value string. Type: string (or Expression with + # resultType string). + attr_accessor :null_value + + + # + # Mapper for ExcelDataset class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Excel', + type: { + name: 'Composite', + class_name: 'ExcelDataset', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + structure: { + client_side_validation: true, + required: false, + serialized_name: 'structure', + type: { + name: 'Object' + } + }, + schema: { + client_side_validation: true, + required: false, + serialized_name: 'schema', + type: { + name: 'Object' + } + }, + linked_service_name: { + client_side_validation: true, + required: true, + serialized_name: 'linkedServiceName', + default_value: {}, + type: { + name: 'Composite', + class_name: 'LinkedServiceReference' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ParameterSpecificationElementType', + type: { + name: 'Composite', + class_name: 'ParameterSpecification' + } + } + } + }, + annotations: { + client_side_validation: true, + required: false, + serialized_name: 'annotations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + folder: { + client_side_validation: true, + required: false, + serialized_name: 'folder', + type: { + name: 'Composite', + class_name: 'DatasetFolder' + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'typeProperties.location', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DatasetLocation', + class_name: 'DatasetLocation' + } + }, + sheet_name: { + client_side_validation: true, + required: true, + serialized_name: 'typeProperties.sheetName', + type: { + name: 'Object' + } + }, + range: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.range', + type: { + name: 'Object' + } + }, + first_row_as_header: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.firstRowAsHeader', + type: { + name: 'Object' + } + }, + compression: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.compression', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DatasetCompression', + class_name: 'DatasetCompression' + } + }, + null_value: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.nullValue', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/excel_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/excel_source.rb new file mode 100644 index 000000000..c171bfca9 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/excel_source.rb @@ -0,0 +1,125 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # A copy activity excel source. + # + class ExcelSource < CopySource + + include MsRestAzure + + + def initialize + @type = "ExcelSource" + end + + attr_accessor :type + + # @return [StoreReadSettings] Excel store settings. + attr_accessor :store_settings + + # @return [Array] Specifies the additional columns to + # be added to source data. Type: array of objects (or Expression with + # resultType array of objects). + attr_accessor :additional_columns + + + # + # Mapper for ExcelSource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExcelSource', + type: { + name: 'Composite', + class_name: 'ExcelSource', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + source_retry_count: { + client_side_validation: true, + required: false, + serialized_name: 'sourceRetryCount', + type: { + name: 'Object' + } + }, + source_retry_wait: { + client_side_validation: true, + required: false, + serialized_name: 'sourceRetryWait', + type: { + name: 'Object' + } + }, + max_concurrent_connections: { + client_side_validation: true, + required: false, + serialized_name: 'maxConcurrentConnections', + type: { + name: 'Object' + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + store_settings: { + client_side_validation: true, + required: false, + serialized_name: 'storeSettings', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'StoreReadSettings', + class_name: 'StoreReadSettings' + } + }, + additional_columns: { + client_side_validation: true, + required: false, + serialized_name: 'additionalColumns', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'AdditionalColumnsElementType', + type: { + name: 'Composite', + class_name: 'AdditionalColumns' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/export_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/export_settings.rb new file mode 100644 index 000000000..7efddf6e9 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/export_settings.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Export command settings. + # + class ExportSettings + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["SnowflakeExportCopyCommand"] = "SnowflakeExportCopyCommand" + + def initialize + @type = "ExportSettings" + end + + attr_accessor :type + + # @return Unmatched properties from the message are deserialized this + # collection + attr_accessor :additional_properties + + + # + # Mapper for ExportSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExportSettings', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'ExportSettings', + class_name: 'ExportSettings', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/factory.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/factory.rb index 27b1e0696..4d9f63108 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/factory.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/factory.rb @@ -31,6 +31,10 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [FactoryRepoConfiguration] Git repo information of the factory. attr_accessor :repo_configuration + # @return [Hash{String => GlobalParameterSpecification}] List of + # parameters for factory. + attr_accessor :global_parameters + # # Mapper for Factory class as Ruby Hash. @@ -166,6 +170,23 @@ module Azure::DataFactory::Mgmt::V2018_06_01 uber_parent: 'FactoryRepoConfiguration', class_name: 'FactoryRepoConfiguration' } + }, + global_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'properties.globalParameters', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'GlobalParameterSpecificationElementType', + type: { + name: 'Composite', + class_name: 'GlobalParameterSpecification' + } + } + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/file_server_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/file_server_read_settings.rb index d9d81c077..3e9cee4c1 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/file_server_read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/file_server_read_settings.rb @@ -39,6 +39,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [Boolean] Indicates whether to enable partition discovery. attr_accessor :enable_partition_discovery + # @return Specify the root path where partition discovery starts from. + # Type: string (or Expression with resultType string). + attr_accessor :partition_root_path + + # @return Indicates whether the source files need to be deleted after + # copy completion. Default is false. Type: boolean (or Expression with + # resultType boolean). + attr_accessor :delete_files_after_completion + # @return The start of file's modified datetime. Type: string (or # Expression with resultType string). attr_accessor :modified_datetime_start @@ -47,6 +56,11 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # Expression with resultType string). attr_accessor :modified_datetime_end + # @return Specify a filter to be used to select a subset of files in the + # folderPath rather than all files. Type: string (or Expression with + # resultType string). + attr_accessor :file_filter + # # Mapper for FileServerReadSettings class as Ruby Hash. @@ -132,6 +146,22 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Boolean' } }, + partition_root_path: { + client_side_validation: true, + required: false, + serialized_name: 'partitionRootPath', + type: { + name: 'Object' + } + }, + delete_files_after_completion: { + client_side_validation: true, + required: false, + serialized_name: 'deleteFilesAfterCompletion', + type: { + name: 'Object' + } + }, modified_datetime_start: { client_side_validation: true, required: false, @@ -147,6 +177,14 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'Object' } + }, + file_filter: { + client_side_validation: true, + required: false, + serialized_name: 'fileFilter', + type: { + name: 'Object' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/format_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/format_read_settings.rb index 522faf0bb..57a579e98 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/format_read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/format_read_settings.rb @@ -13,6 +13,9 @@ module Azure::DataFactory::Mgmt::V2018_06_01 include MsRestAzure @@discriminatorMap = Hash.new + @@discriminatorMap["BinaryReadSettings"] = "BinaryReadSettings" + @@discriminatorMap["XmlReadSettings"] = "XmlReadSettings" + @@discriminatorMap["JsonReadSettings"] = "JsonReadSettings" @@discriminatorMap["DelimitedTextReadSettings"] = "DelimitedTextReadSettings" def initialize diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ftp_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ftp_read_settings.rb index 1cd046dbf..dbb422441 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ftp_read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ftp_read_settings.rb @@ -31,6 +31,18 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # resultType string). attr_accessor :wildcard_file_name + # @return [Boolean] Indicates whether to enable partition discovery. + attr_accessor :enable_partition_discovery + + # @return Specify the root path where partition discovery starts from. + # Type: string (or Expression with resultType string). + attr_accessor :partition_root_path + + # @return Indicates whether the source files need to be deleted after + # copy completion. Default is false. Type: boolean (or Expression with + # resultType boolean). + attr_accessor :delete_files_after_completion + # @return Point to a text file that lists each file (relative path to the # path configured in the dataset) that you want to copy. Type: string (or # Expression with resultType string). @@ -109,6 +121,30 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Object' } }, + enable_partition_discovery: { + client_side_validation: true, + required: false, + serialized_name: 'enablePartitionDiscovery', + type: { + name: 'Boolean' + } + }, + partition_root_path: { + client_side_validation: true, + required: false, + serialized_name: 'partitionRootPath', + type: { + name: 'Object' + } + }, + delete_files_after_completion: { + client_side_validation: true, + required: false, + serialized_name: 'deleteFilesAfterCompletion', + type: { + name: 'Object' + } + }, file_list_path: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/get_metadata_activity.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/get_metadata_activity.rb index 2798df7d5..7bac3a0ed 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/get_metadata_activity.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/get_metadata_activity.rb @@ -25,6 +25,12 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return Fields of metadata to get from dataset. attr_accessor :field_list + # @return [StoreReadSettings] GetMetadata activity store settings. + attr_accessor :store_settings + + # @return [FormatReadSettings] GetMetadata activity format settings. + attr_accessor :format_settings + # # Mapper for GetMetadataActivity class as Ruby Hash. @@ -155,6 +161,28 @@ module Azure::DataFactory::Mgmt::V2018_06_01 } } } + }, + store_settings: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.storeSettings', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'StoreReadSettings', + class_name: 'StoreReadSettings' + } + }, + format_settings: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.formatSettings', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'FormatReadSettings', + class_name: 'FormatReadSettings' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/global_parameter_specification.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/global_parameter_specification.rb new file mode 100644 index 000000000..b55b54b51 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/global_parameter_specification.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Definition of a single parameter for an entity. + # + class GlobalParameterSpecification + + include MsRestAzure + + # @return [GlobalParameterType] Global Parameter type. Possible values + # include: 'Object', 'String', 'Int', 'Float', 'Bool', 'Array' + attr_accessor :type + + # @return Value of parameter. + attr_accessor :value + + + # + # Mapper for GlobalParameterSpecification class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GlobalParameterSpecification', + type: { + name: 'Composite', + class_name: 'GlobalParameterSpecification', + model_properties: { + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: true, + serialized_name: 'value', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/global_parameter_type.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/global_parameter_type.rb new file mode 100644 index 000000000..5d26a38cf --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/global_parameter_type.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Defines values for GlobalParameterType + # + module GlobalParameterType + Object = "Object" + String = "String" + Int = "Int" + Float = "Float" + Bool = "Bool" + Array = "Array" + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/google_cloud_storage_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/google_cloud_storage_read_settings.rb index 33dc18457..b1df30095 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/google_cloud_storage_read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/google_cloud_storage_read_settings.rb @@ -43,6 +43,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [Boolean] Indicates whether to enable partition discovery. attr_accessor :enable_partition_discovery + # @return Specify the root path where partition discovery starts from. + # Type: string (or Expression with resultType string). + attr_accessor :partition_root_path + + # @return Indicates whether the source files need to be deleted after + # copy completion. Default is false. Type: boolean (or Expression with + # resultType boolean). + attr_accessor :delete_files_after_completion + # @return The start of file's modified datetime. Type: string (or # Expression with resultType string). attr_accessor :modified_datetime_start @@ -144,6 +153,22 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Boolean' } }, + partition_root_path: { + client_side_validation: true, + required: false, + serialized_name: 'partitionRootPath', + type: { + name: 'Object' + } + }, + delete_files_after_completion: { + client_side_validation: true, + required: false, + serialized_name: 'deleteFilesAfterCompletion', + type: { + name: 'Object' + } + }, modified_datetime_start: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/hdfs_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/hdfs_read_settings.rb index e0ec7e28f..33cca809c 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/hdfs_read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/hdfs_read_settings.rb @@ -39,6 +39,10 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [Boolean] Indicates whether to enable partition discovery. attr_accessor :enable_partition_discovery + # @return Specify the root path where partition discovery starts from. + # Type: string (or Expression with resultType string). + attr_accessor :partition_root_path + # @return The start of file's modified datetime. Type: string (or # Expression with resultType string). attr_accessor :modified_datetime_start @@ -135,6 +139,14 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Boolean' } }, + partition_root_path: { + client_side_validation: true, + required: false, + serialized_name: 'partitionRootPath', + type: { + name: 'Object' + } + }, modified_datetime_start: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/http_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/http_read_settings.rb index 427d585e7..bb44328df 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/http_read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/http_read_settings.rb @@ -35,6 +35,13 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # from HTTP server. attr_accessor :request_timeout + # @return [Boolean] Indicates whether to enable partition discovery. + attr_accessor :enable_partition_discovery + + # @return Specify the root path where partition discovery starts from. + # Type: string (or Expression with resultType string). + attr_accessor :partition_root_path + # # Mapper for HttpReadSettings class as Ruby Hash. @@ -111,6 +118,22 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'Object' } + }, + enable_partition_discovery: { + client_side_validation: true, + required: false, + serialized_name: 'enablePartitionDiscovery', + type: { + name: 'Boolean' + } + }, + partition_root_path: { + client_side_validation: true, + required: false, + serialized_name: 'partitionRootPath', + type: { + name: 'Object' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/import_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/import_settings.rb new file mode 100644 index 000000000..89202dae4 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/import_settings.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Import command settings. + # + class ImportSettings + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["SnowflakeImportCopyCommand"] = "SnowflakeImportCopyCommand" + + def initialize + @type = "ImportSettings" + end + + attr_accessor :type + + # @return Unmatched properties from the message are deserialized this + # collection + attr_accessor :additional_properties + + + # + # Mapper for ImportSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ImportSettings', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'ImportSettings', + class_name: 'ImportSettings', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_properties.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_properties.rb index b2d356574..213d8a21f 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_properties.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/integration_runtime_ssis_properties.rb @@ -41,6 +41,10 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # for a SSIS integration runtime. attr_accessor :express_custom_setup_properties + # @return [Array] Package stores for the SSIS Integration + # Runtime. + attr_accessor :package_stores + # # Mapper for IntegrationRuntimeSsisProperties class as Ruby Hash. @@ -131,6 +135,23 @@ module Azure::DataFactory::Mgmt::V2018_06_01 } } } + }, + package_stores: { + client_side_validation: true, + required: false, + serialized_name: 'packageStores', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PackageStoreElementType', + type: { + name: 'Composite', + class_name: 'PackageStore' + } + } + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/json_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/json_read_settings.rb new file mode 100644 index 000000000..bab9e32a6 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/json_read_settings.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Json read settings. + # + class JsonReadSettings < FormatReadSettings + + include MsRestAzure + + + def initialize + @type = "JsonReadSettings" + end + + attr_accessor :type + + # @return [CompressionReadSettings] Compression settings. + attr_accessor :compression_properties + + + # + # Mapper for JsonReadSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JsonReadSettings', + type: { + name: 'Composite', + class_name: 'JsonReadSettings', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + compression_properties: { + client_side_validation: true, + required: false, + serialized_name: 'compressionProperties', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'CompressionReadSettings', + class_name: 'CompressionReadSettings' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/json_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/json_source.rb index 5523f9ec3..2d16a85bc 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/json_source.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/json_source.rb @@ -22,6 +22,9 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return [StoreReadSettings] Json store settings. attr_accessor :store_settings + # @return [JsonReadSettings] Json format settings. + attr_accessor :format_settings + # @return [Array] Specifies the additional columns to # be added to source data. Type: array of objects (or Expression with # resultType array of objects). @@ -99,6 +102,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 class_name: 'StoreReadSettings' } }, + format_settings: { + client_side_validation: true, + required: false, + serialized_name: 'formatSettings', + type: { + name: 'Composite', + class_name: 'JsonReadSettings' + } + }, additional_columns: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/linked_service.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/linked_service.rb index 8937bfe1f..46e5521d0 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/linked_service.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/linked_service.rb @@ -15,6 +15,8 @@ module Azure::DataFactory::Mgmt::V2018_06_01 include MsRestAzure @@discriminatorMap = Hash.new + @@discriminatorMap["SharePointOnlineList"] = "SharePointOnlineListLinkedService" + @@discriminatorMap["Snowflake"] = "SnowflakeLinkedService" @@discriminatorMap["AzureFunction"] = "AzureFunctionLinkedService" @@discriminatorMap["AzureDataExplorer"] = "AzureDataExplorerLinkedService" @@discriminatorMap["SapTable"] = "SapTableLinkedService" diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/odata_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/odata_source.rb index 55e6ba665..b24f5898b 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/odata_source.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/odata_source.rb @@ -23,6 +23,12 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # with resultType string). attr_accessor :query + # @return The timeout (TimeSpan) to get an HTTP response. It is the + # timeout to get a response, not the timeout to read response data. + # Default value: 00:05:00. Type: string (or Expression with resultType + # string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + attr_accessor :http_request_timeout + # @return [Array] Specifies the additional columns to # be added to source data. Type: array of objects (or Expression with # resultType array of objects). @@ -97,6 +103,14 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Object' } }, + http_request_timeout: { + client_side_validation: true, + required: false, + serialized_name: 'httpRequestTimeout', + type: { + name: 'Object' + } + }, additional_columns: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/package_store.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/package_store.rb new file mode 100644 index 000000000..e9882e243 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/package_store.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Package store for the SSIS integration runtime. + # + class PackageStore + + include MsRestAzure + + # @return [String] The name of the package store + attr_accessor :name + + # @return [EntityReference] The package store linked service reference. + attr_accessor :package_store_linked_service + + + # + # Mapper for PackageStore class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PackageStore', + type: { + name: 'Composite', + class_name: 'PackageStore', + model_properties: { + name: { + client_side_validation: true, + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + package_store_linked_service: { + client_side_validation: true, + required: true, + serialized_name: 'packageStoreLinkedService', + type: { + name: 'Composite', + class_name: 'EntityReference' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_cloud_for_customer_sink.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_cloud_for_customer_sink.rb index 43f68e123..a8855082f 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_cloud_for_customer_sink.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_cloud_for_customer_sink.rb @@ -24,6 +24,12 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # 'Update' attr_accessor :write_behavior + # @return The timeout (TimeSpan) to get an HTTP response. It is the + # timeout to get a response, not the timeout to read response data. + # Default value: 00:05:00. Type: string (or Expression with resultType + # string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + attr_accessor :http_request_timeout + # # Mapper for SapCloudForCustomerSink class as Ruby Hash. @@ -108,6 +114,14 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'String' } + }, + http_request_timeout: { + client_side_validation: true, + required: false, + serialized_name: 'httpRequestTimeout', + type: { + name: 'Object' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_cloud_for_customer_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_cloud_for_customer_source.rb index bd922942c..cb0a56b63 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_cloud_for_customer_source.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_cloud_for_customer_source.rb @@ -23,6 +23,12 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # Type: string (or Expression with resultType string). attr_accessor :query + # @return The timeout (TimeSpan) to get an HTTP response. It is the + # timeout to get a response, not the timeout to read response data. + # Default value: 00:05:00. Type: string (or Expression with resultType + # string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + attr_accessor :http_request_timeout + # # Mapper for SapCloudForCustomerSource class as Ruby Hash. @@ -116,6 +122,14 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'Object' } + }, + http_request_timeout: { + client_side_validation: true, + required: false, + serialized_name: 'httpRequestTimeout', + type: { + name: 'Object' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_ecc_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_ecc_source.rb index 11d9b70ee..393e0f50e 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_ecc_source.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_ecc_source.rb @@ -23,6 +23,12 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # Expression with resultType string). attr_accessor :query + # @return The timeout (TimeSpan) to get an HTTP response. It is the + # timeout to get a response, not the timeout to read response data. + # Default value: 00:05:00. Type: string (or Expression with resultType + # string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + attr_accessor :http_request_timeout + # # Mapper for SapEccSource class as Ruby Hash. @@ -116,6 +122,14 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'Object' } + }, + http_request_timeout: { + client_side_validation: true, + required: false, + serialized_name: 'httpRequestTimeout', + type: { + name: 'Object' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_hana_linked_service.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_hana_linked_service.rb index 8f2ff21ef..a990172b2 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_hana_linked_service.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_hana_linked_service.rb @@ -141,7 +141,7 @@ module Azure::DataFactory::Mgmt::V2018_06_01 }, server: { client_side_validation: true, - required: true, + required: false, serialized_name: 'typeProperties.server', type: { name: 'Object' diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sftp_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sftp_read_settings.rb index 8b3f3a6ff..2e3aa9cf3 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sftp_read_settings.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sftp_read_settings.rb @@ -31,11 +31,23 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # resultType string). attr_accessor :wildcard_file_name + # @return [Boolean] Indicates whether to enable partition discovery. + attr_accessor :enable_partition_discovery + + # @return Specify the root path where partition discovery starts from. + # Type: string (or Expression with resultType string). + attr_accessor :partition_root_path + # @return Point to a text file that lists each file (relative path to the # path configured in the dataset) that you want to copy. Type: string (or # Expression with resultType string). attr_accessor :file_list_path + # @return Indicates whether the source files need to be deleted after + # copy completion. Default is false. Type: boolean (or Expression with + # resultType boolean). + attr_accessor :delete_files_after_completion + # @return The start of file's modified datetime. Type: string (or # Expression with resultType string). attr_accessor :modified_datetime_start @@ -113,6 +125,22 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Object' } }, + enable_partition_discovery: { + client_side_validation: true, + required: false, + serialized_name: 'enablePartitionDiscovery', + type: { + name: 'Boolean' + } + }, + partition_root_path: { + client_side_validation: true, + required: false, + serialized_name: 'partitionRootPath', + type: { + name: 'Object' + } + }, file_list_path: { client_side_validation: true, required: false, @@ -121,6 +149,14 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Object' } }, + delete_files_after_completion: { + client_side_validation: true, + required: false, + serialized_name: 'deleteFilesAfterCompletion', + type: { + name: 'Object' + } + }, modified_datetime_start: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_linked_service.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_linked_service.rb new file mode 100644 index 000000000..28db8e47f --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_linked_service.rb @@ -0,0 +1,184 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # SharePoint Online List linked service. + # + class SharePointOnlineListLinkedService < LinkedService + + include MsRestAzure + + + def initialize + @type = "SharePointOnlineList" + end + + attr_accessor :type + + # @return The URL of the SharePoint Online site. For example, + # https://contoso.sharepoint.com/sites/siteName. Type: string (or + # Expression with resultType string). + attr_accessor :site_url + + # @return The tenant ID under which your application resides. You can + # find it from Azure portal Active Directory overview page. Type: string + # (or Expression with resultType string). + attr_accessor :tenant_id + + # @return The application (client) ID of your application registered in + # Azure Active Directory. Make sure to grant SharePoint site permission + # to this application. Type: string (or Expression with resultType + # string). + attr_accessor :service_principal_id + + # @return [SecretBase] The client secret of your application registered + # in Azure Active Directory. Type: string (or Expression with resultType + # string). + attr_accessor :service_principal_key + + # @return The encrypted credential used for authentication. Credentials + # are encrypted using the integration runtime credential manager. Type: + # string (or Expression with resultType string). + attr_accessor :encrypted_credential + + + # + # Mapper for SharePointOnlineListLinkedService class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SharePointOnlineList', + type: { + name: 'Composite', + class_name: 'SharePointOnlineListLinkedService', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + connect_via: { + client_side_validation: true, + required: false, + serialized_name: 'connectVia', + type: { + name: 'Composite', + class_name: 'IntegrationRuntimeReference' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ParameterSpecificationElementType', + type: { + name: 'Composite', + class_name: 'ParameterSpecification' + } + } + } + }, + annotations: { + client_side_validation: true, + required: false, + serialized_name: 'annotations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + site_url: { + client_side_validation: true, + required: true, + serialized_name: 'typeProperties.siteUrl', + type: { + name: 'Object' + } + }, + tenant_id: { + client_side_validation: true, + required: true, + serialized_name: 'typeProperties.tenantId', + type: { + name: 'Object' + } + }, + service_principal_id: { + client_side_validation: true, + required: true, + serialized_name: 'typeProperties.servicePrincipalId', + type: { + name: 'Object' + } + }, + service_principal_key: { + client_side_validation: true, + required: true, + serialized_name: 'typeProperties.servicePrincipalKey', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'SecretBase', + class_name: 'SecretBase' + } + }, + encrypted_credential: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.encryptedCredential', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_resource_dataset.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_resource_dataset.rb new file mode 100644 index 000000000..47114d343 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_resource_dataset.rb @@ -0,0 +1,153 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # The sharepoint online list resource dataset. + # + class SharePointOnlineListResourceDataset < Dataset + + include MsRestAzure + + + def initialize + @type = "SharePointOnlineListResource" + end + + attr_accessor :type + + # @return The name of the SharePoint Online list. Type: string (or + # Expression with resultType string). + attr_accessor :list_name + + + # + # Mapper for SharePointOnlineListResourceDataset class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SharePointOnlineListResource', + type: { + name: 'Composite', + class_name: 'SharePointOnlineListResourceDataset', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + structure: { + client_side_validation: true, + required: false, + serialized_name: 'structure', + type: { + name: 'Object' + } + }, + schema: { + client_side_validation: true, + required: false, + serialized_name: 'schema', + type: { + name: 'Object' + } + }, + linked_service_name: { + client_side_validation: true, + required: true, + serialized_name: 'linkedServiceName', + default_value: {}, + type: { + name: 'Composite', + class_name: 'LinkedServiceReference' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ParameterSpecificationElementType', + type: { + name: 'Composite', + class_name: 'ParameterSpecification' + } + } + } + }, + annotations: { + client_side_validation: true, + required: false, + serialized_name: 'annotations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + folder: { + client_side_validation: true, + required: false, + serialized_name: 'folder', + type: { + name: 'Composite', + class_name: 'DatasetFolder' + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + list_name: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.listName', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_source.rb new file mode 100644 index 000000000..f3703af9b --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/share_point_online_list_source.rb @@ -0,0 +1,116 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # A copy activity source for sharePoint online list source. + # + class SharePointOnlineListSource < CopySource + + include MsRestAzure + + + def initialize + @type = "SharePointOnlineListSource" + end + + attr_accessor :type + + # @return The OData query to filter the data in SharePoint Online list. + # For example, "$top=1". Type: string (or Expression with resultType + # string). + attr_accessor :query + + # @return The wait time to get a response from SharePoint Online. Default + # value is 5 minutes (00:05:00). Type: string (or Expression with + # resultType string), pattern: + # ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + attr_accessor :http_request_timeout + + + # + # Mapper for SharePointOnlineListSource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SharePointOnlineListSource', + type: { + name: 'Composite', + class_name: 'SharePointOnlineListSource', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + source_retry_count: { + client_side_validation: true, + required: false, + serialized_name: 'sourceRetryCount', + type: { + name: 'Object' + } + }, + source_retry_wait: { + client_side_validation: true, + required: false, + serialized_name: 'sourceRetryWait', + type: { + name: 'Object' + } + }, + max_concurrent_connections: { + client_side_validation: true, + required: false, + serialized_name: 'maxConcurrentConnections', + type: { + name: 'Object' + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + query: { + client_side_validation: true, + required: false, + serialized_name: 'query', + type: { + name: 'Object' + } + }, + http_request_timeout: { + client_side_validation: true, + required: false, + serialized_name: 'httpRequestTimeout', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_dataset.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_dataset.rb new file mode 100644 index 000000000..63dc0369d --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_dataset.rb @@ -0,0 +1,165 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # The snowflake dataset. + # + class SnowflakeDataset < Dataset + + include MsRestAzure + + + def initialize + @type = "SnowflakeTable" + end + + attr_accessor :type + + # @return The schema name of the Snowflake database. Type: string (or + # Expression with resultType string). + attr_accessor :snowflake_dataset_schema + + # @return The table name of the Snowflake database. Type: string (or + # Expression with resultType string). + attr_accessor :table + + + # + # Mapper for SnowflakeDataset class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SnowflakeTable', + type: { + name: 'Composite', + class_name: 'SnowflakeDataset', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + structure: { + client_side_validation: true, + required: false, + serialized_name: 'structure', + type: { + name: 'Object' + } + }, + schema: { + client_side_validation: true, + required: false, + serialized_name: 'schema', + type: { + name: 'Object' + } + }, + linked_service_name: { + client_side_validation: true, + required: true, + serialized_name: 'linkedServiceName', + default_value: {}, + type: { + name: 'Composite', + class_name: 'LinkedServiceReference' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ParameterSpecificationElementType', + type: { + name: 'Composite', + class_name: 'ParameterSpecification' + } + } + } + }, + annotations: { + client_side_validation: true, + required: false, + serialized_name: 'annotations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + folder: { + client_side_validation: true, + required: false, + serialized_name: 'folder', + type: { + name: 'Composite', + class_name: 'DatasetFolder' + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + snowflake_dataset_schema: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.schema', + type: { + name: 'Object' + } + }, + table: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.table', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_export_copy_command.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_export_copy_command.rb new file mode 100644 index 000000000..f4bb8a27c --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_export_copy_command.rb @@ -0,0 +1,109 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Snowflake export command settings. + # + class SnowflakeExportCopyCommand < ExportSettings + + include MsRestAzure + + + def initialize + @type = "SnowflakeExportCopyCommand" + end + + attr_accessor :type + + # @return Additional copy options directly passed to snowflake Copy + # Command. Type: key value pairs (value should be string type) (or + # Expression with resultType object). Example: "additionalCopyOptions": { + # "DATE_FORMAT": "MM/DD/YYYY", "TIME_FORMAT": "'HH24:MI:SS.FF'" } + attr_accessor :additional_copy_options + + # @return Additional format options directly passed to snowflake Copy + # Command. Type: key value pairs (value should be string type) (or + # Expression with resultType object). Example: "additionalFormatOptions": + # { "OVERWRITE": "TRUE", "MAX_FILE_SIZE": "'FALSE'" } + attr_accessor :additional_format_options + + + # + # Mapper for SnowflakeExportCopyCommand class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SnowflakeExportCopyCommand', + type: { + name: 'Composite', + class_name: 'SnowflakeExportCopyCommand', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + additional_copy_options: { + client_side_validation: true, + required: false, + serialized_name: 'additionalCopyOptions', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + additional_format_options: { + client_side_validation: true, + required: false, + serialized_name: 'additionalFormatOptions', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_import_copy_command.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_import_copy_command.rb new file mode 100644 index 000000000..e60a479f9 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_import_copy_command.rb @@ -0,0 +1,109 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Snowflake import command settings. + # + class SnowflakeImportCopyCommand < ImportSettings + + include MsRestAzure + + + def initialize + @type = "SnowflakeImportCopyCommand" + end + + attr_accessor :type + + # @return Additional copy options directly passed to snowflake Copy + # Command. Type: key value pairs (value should be string type) (or + # Expression with resultType object). Example: "additionalCopyOptions": { + # "DATE_FORMAT": "MM/DD/YYYY", "TIME_FORMAT": "'HH24:MI:SS.FF'" } + attr_accessor :additional_copy_options + + # @return Additional format options directly passed to snowflake Copy + # Command. Type: key value pairs (value should be string type) (or + # Expression with resultType object). Example: "additionalFormatOptions": + # { "FORCE": "TRUE", "LOAD_UNCERTAIN_FILES": "'FALSE'" } + attr_accessor :additional_format_options + + + # + # Mapper for SnowflakeImportCopyCommand class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SnowflakeImportCopyCommand', + type: { + name: 'Composite', + class_name: 'SnowflakeImportCopyCommand', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + additional_copy_options: { + client_side_validation: true, + required: false, + serialized_name: 'additionalCopyOptions', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + additional_format_options: { + client_side_validation: true, + required: false, + serialized_name: 'additionalFormatOptions', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_linked_service.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_linked_service.rb new file mode 100644 index 000000000..c01695fad --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_linked_service.rb @@ -0,0 +1,152 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Snowflake linked service. + # + class SnowflakeLinkedService < LinkedService + + include MsRestAzure + + + def initialize + @type = "Snowflake" + end + + attr_accessor :type + + # @return The connection string of snowflake. Type: string, SecureString. + attr_accessor :connection_string + + # @return [AzureKeyVaultSecretReference] The Azure key vault secret + # reference of password in connection string. + attr_accessor :password + + # @return The encrypted credential used for authentication. Credentials + # are encrypted using the integration runtime credential manager. Type: + # string (or Expression with resultType string). + attr_accessor :encrypted_credential + + + # + # Mapper for SnowflakeLinkedService class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Snowflake', + type: { + name: 'Composite', + class_name: 'SnowflakeLinkedService', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + connect_via: { + client_side_validation: true, + required: false, + serialized_name: 'connectVia', + type: { + name: 'Composite', + class_name: 'IntegrationRuntimeReference' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ParameterSpecificationElementType', + type: { + name: 'Composite', + class_name: 'ParameterSpecification' + } + } + } + }, + annotations: { + client_side_validation: true, + required: false, + serialized_name: 'annotations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + connection_string: { + client_side_validation: true, + required: true, + serialized_name: 'typeProperties.connectionString', + type: { + name: 'Object' + } + }, + password: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.password', + type: { + name: 'Composite', + class_name: 'AzureKeyVaultSecretReference' + } + }, + encrypted_credential: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.encryptedCredential', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_sink.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_sink.rb new file mode 100644 index 000000000..758698588 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_sink.rb @@ -0,0 +1,129 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # A copy activity snowflake sink. + # + class SnowflakeSink < CopySink + + include MsRestAzure + + + def initialize + @type = "SnowflakeSink" + end + + attr_accessor :type + + # @return SQL pre-copy script. Type: string (or Expression with + # resultType string). + attr_accessor :pre_copy_script + + # @return [SnowflakeImportCopyCommand] Snowflake import settings. + attr_accessor :import_settings + + + # + # Mapper for SnowflakeSink class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SnowflakeSink', + type: { + name: 'Composite', + class_name: 'SnowflakeSink', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + write_batch_size: { + client_side_validation: true, + required: false, + serialized_name: 'writeBatchSize', + type: { + name: 'Object' + } + }, + write_batch_timeout: { + client_side_validation: true, + required: false, + serialized_name: 'writeBatchTimeout', + type: { + name: 'Object' + } + }, + sink_retry_count: { + client_side_validation: true, + required: false, + serialized_name: 'sinkRetryCount', + type: { + name: 'Object' + } + }, + sink_retry_wait: { + client_side_validation: true, + required: false, + serialized_name: 'sinkRetryWait', + type: { + name: 'Object' + } + }, + max_concurrent_connections: { + client_side_validation: true, + required: false, + serialized_name: 'maxConcurrentConnections', + type: { + name: 'Object' + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + pre_copy_script: { + client_side_validation: true, + required: false, + serialized_name: 'preCopyScript', + type: { + name: 'Object' + } + }, + import_settings: { + client_side_validation: true, + required: false, + serialized_name: 'importSettings', + type: { + name: 'Composite', + class_name: 'SnowflakeImportCopyCommand' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_source.rb new file mode 100644 index 000000000..db89ad04d --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/snowflake_source.rb @@ -0,0 +1,113 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # A copy activity snowflake source. + # + class SnowflakeSource < CopySource + + include MsRestAzure + + + def initialize + @type = "SnowflakeSource" + end + + attr_accessor :type + + # @return Snowflake Sql query. Type: string (or Expression with + # resultType string). + attr_accessor :query + + # @return [SnowflakeExportCopyCommand] Snowflake export settings. + attr_accessor :export_settings + + + # + # Mapper for SnowflakeSource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SnowflakeSource', + type: { + name: 'Composite', + class_name: 'SnowflakeSource', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + source_retry_count: { + client_side_validation: true, + required: false, + serialized_name: 'sourceRetryCount', + type: { + name: 'Object' + } + }, + source_retry_wait: { + client_side_validation: true, + required: false, + serialized_name: 'sourceRetryWait', + type: { + name: 'Object' + } + }, + max_concurrent_connections: { + client_side_validation: true, + required: false, + serialized_name: 'maxConcurrentConnections', + type: { + name: 'Object' + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + query: { + client_side_validation: true, + required: false, + serialized_name: 'query', + type: { + name: 'Object' + } + }, + export_settings: { + client_side_validation: true, + required: false, + serialized_name: 'exportSettings', + type: { + name: 'Composite', + class_name: 'SnowflakeExportCopyCommand' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_dwsource.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_dwsource.rb index b0c21f9f9..b80b317fa 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_dwsource.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_dwsource.rb @@ -33,6 +33,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # Expression with resultType object), itemType: StoredProcedureParameter. attr_accessor :stored_procedure_parameters + # @return [SqlPartitionOption] The partition mechanism that will be used + # for Sql read in parallel. Possible values include: 'None', + # 'PhysicalPartitionsOfTable', 'DynamicRange' + attr_accessor :partition_option + + # @return [SqlPartitionSettings] The settings that will be leveraged for + # Sql source partitioning. + attr_accessor :partition_settings + # # Mapper for SqlDWSource class as Ruby Hash. @@ -142,6 +151,23 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'Object' } + }, + partition_option: { + client_side_validation: true, + required: false, + serialized_name: 'partitionOption', + type: { + name: 'String' + } + }, + partition_settings: { + client_side_validation: true, + required: false, + serialized_name: 'partitionSettings', + type: { + name: 'Composite', + class_name: 'SqlPartitionSettings' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_misource.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_misource.rb index 768152408..c67595516 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_misource.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_misource.rb @@ -36,6 +36,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return Which additional types to produce. attr_accessor :produce_additional_types + # @return [SqlPartitionOption] The partition mechanism that will be used + # for Sql read in parallel. Possible values include: 'None', + # 'PhysicalPartitionsOfTable', 'DynamicRange' + attr_accessor :partition_option + + # @return [SqlPartitionSettings] The settings that will be leveraged for + # Sql source partitioning. + attr_accessor :partition_settings + # # Mapper for SqlMISource class as Ruby Hash. @@ -162,6 +171,23 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'Object' } + }, + partition_option: { + client_side_validation: true, + required: false, + serialized_name: 'partitionOption', + type: { + name: 'String' + } + }, + partition_settings: { + client_side_validation: true, + required: false, + serialized_name: 'partitionSettings', + type: { + name: 'Composite', + class_name: 'SqlPartitionSettings' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_partition_option.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_partition_option.rb new file mode 100644 index 000000000..8e3ee4838 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_partition_option.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Defines values for SqlPartitionOption + # + module SqlPartitionOption + None = "None" + PhysicalPartitionsOfTable = "PhysicalPartitionsOfTable" + DynamicRange = "DynamicRange" + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_partition_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_partition_settings.rb new file mode 100644 index 000000000..de34522ea --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_partition_settings.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # The settings that will be leveraged for Sql source partitioning. + # + class SqlPartitionSettings + + include MsRestAzure + + # @return The name of the column in integer or datetime type that will be + # used for proceeding partitioning. If not specified, the primary key of + # the table is auto-detected and used as the partition column. Type: + # string (or Expression with resultType string). + attr_accessor :partition_column_name + + # @return The maximum value of the partition column for partition range + # splitting. This value is used to decide the partition stride, not for + # filtering the rows in table. All rows in the table or query result will + # be partitioned and copied. Type: string (or Expression with resultType + # string). + attr_accessor :partition_upper_bound + + # @return The minimum value of the partition column for partition range + # splitting. This value is used to decide the partition stride, not for + # filtering the rows in table. All rows in the table or query result will + # be partitioned and copied. Type: string (or Expression with resultType + # string). + attr_accessor :partition_lower_bound + + + # + # Mapper for SqlPartitionSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SqlPartitionSettings', + type: { + name: 'Composite', + class_name: 'SqlPartitionSettings', + model_properties: { + partition_column_name: { + client_side_validation: true, + required: false, + serialized_name: 'partitionColumnName', + type: { + name: 'Object' + } + }, + partition_upper_bound: { + client_side_validation: true, + required: false, + serialized_name: 'partitionUpperBound', + type: { + name: 'Object' + } + }, + partition_lower_bound: { + client_side_validation: true, + required: false, + serialized_name: 'partitionLowerBound', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_server_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_server_source.rb index 3395d9ff6..9ce341a13 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_server_source.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_server_source.rb @@ -36,6 +36,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # @return Which additional types to produce. attr_accessor :produce_additional_types + # @return [SqlPartitionOption] The partition mechanism that will be used + # for Sql read in parallel. Possible values include: 'None', + # 'PhysicalPartitionsOfTable', 'DynamicRange' + attr_accessor :partition_option + + # @return [SqlPartitionSettings] The settings that will be leveraged for + # Sql source partitioning. + attr_accessor :partition_settings + # # Mapper for SqlServerSource class as Ruby Hash. @@ -162,6 +171,23 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'Object' } + }, + partition_option: { + client_side_validation: true, + required: false, + serialized_name: 'partitionOption', + type: { + name: 'String' + } + }, + partition_settings: { + client_side_validation: true, + required: false, + serialized_name: 'partitionSettings', + type: { + name: 'Composite', + class_name: 'SqlPartitionSettings' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_source.rb index ebfddf0e1..61140b00a 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_source.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sql_source.rb @@ -40,6 +40,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # resultType string). attr_accessor :isolation_level + # @return [SqlPartitionOption] The partition mechanism that will be used + # for Sql read in parallel. Possible values include: 'None', + # 'PhysicalPartitionsOfTable', 'DynamicRange' + attr_accessor :partition_option + + # @return [SqlPartitionSettings] The settings that will be leveraged for + # Sql source partitioning. + attr_accessor :partition_settings + # # Mapper for SqlSource class as Ruby Hash. @@ -166,6 +175,23 @@ module Azure::DataFactory::Mgmt::V2018_06_01 type: { name: 'Object' } + }, + partition_option: { + client_side_validation: true, + required: false, + serialized_name: 'partitionOption', + type: { + name: 'String' + } + }, + partition_settings: { + client_side_validation: true, + required: false, + serialized_name: 'partitionSettings', + type: { + name: 'Composite', + class_name: 'SqlPartitionSettings' + } } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ssis_package_location_type.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ssis_package_location_type.rb index ef90df630..af57fa442 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ssis_package_location_type.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ssis_package_location_type.rb @@ -12,6 +12,7 @@ module Azure::DataFactory::Mgmt::V2018_06_01 SSISDB = "SSISDB" File = "File" InlinePackage = "InlinePackage" + PackageStore = "PackageStore" end end end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ssispackage_location.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ssispackage_location.rb index 092a36c28..15c020d6f 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ssispackage_location.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/ssispackage_location.rb @@ -17,7 +17,8 @@ module Azure::DataFactory::Mgmt::V2018_06_01 attr_accessor :package_path # @return [SsisPackageLocationType] The type of SSIS package location. - # Possible values include: 'SSISDB', 'File', 'InlinePackage' + # Possible values include: 'SSISDB', 'File', 'InlinePackage', + # 'PackageStore' attr_accessor :type # @return [SecretBase] Password of the package. @@ -30,6 +31,10 @@ module Azure::DataFactory::Mgmt::V2018_06_01 # (or Expression with resultType string). attr_accessor :configuration_path + # @return [SSISAccessCredential] The configuration file access + # credential. + attr_accessor :configuration_access_credential + # @return [String] The package name. attr_accessor :package_name @@ -101,6 +106,15 @@ module Azure::DataFactory::Mgmt::V2018_06_01 name: 'Object' } }, + configuration_access_credential: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.configurationAccessCredential', + type: { + name: 'Composite', + class_name: 'SSISAccessCredential' + } + }, package_name: { client_side_validation: true, required: false, diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/wait_activity.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/wait_activity.rb index 5949ff641..b442161cd 100644 --- a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/wait_activity.rb +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/wait_activity.rb @@ -19,7 +19,7 @@ module Azure::DataFactory::Mgmt::V2018_06_01 attr_accessor :type - # @return [Integer] Duration in seconds. + # @return Duration in seconds. attr_accessor :wait_time_in_seconds @@ -114,7 +114,7 @@ module Azure::DataFactory::Mgmt::V2018_06_01 required: true, serialized_name: 'typeProperties.waitTimeInSeconds', type: { - name: 'Number' + name: 'Object' } } } diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_dataset.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_dataset.rb new file mode 100644 index 000000000..62408089f --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_dataset.rb @@ -0,0 +1,198 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Xml dataset. + # + class XmlDataset < Dataset + + include MsRestAzure + + + def initialize + @type = "Xml" + end + + attr_accessor :type + + # @return [DatasetLocation] The location of the json data storage. + attr_accessor :location + + # @return The code page name of the preferred encoding. If not specified, + # the default value is UTF-8, unless BOM denotes another Unicode + # encoding. Refer to the name column of the table in the following link + # to set supported values: + # https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: + # string (or Expression with resultType string). + attr_accessor :encoding_name + + # @return The null value string. Type: string (or Expression with + # resultType string). + attr_accessor :null_value + + # @return [DatasetCompression] The data compression method used for the + # json dataset. + attr_accessor :compression + + + # + # Mapper for XmlDataset class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Xml', + type: { + name: 'Composite', + class_name: 'XmlDataset', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + structure: { + client_side_validation: true, + required: false, + serialized_name: 'structure', + type: { + name: 'Object' + } + }, + schema: { + client_side_validation: true, + required: false, + serialized_name: 'schema', + type: { + name: 'Object' + } + }, + linked_service_name: { + client_side_validation: true, + required: true, + serialized_name: 'linkedServiceName', + default_value: {}, + type: { + name: 'Composite', + class_name: 'LinkedServiceReference' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ParameterSpecificationElementType', + type: { + name: 'Composite', + class_name: 'ParameterSpecification' + } + } + } + }, + annotations: { + client_side_validation: true, + required: false, + serialized_name: 'annotations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + folder: { + client_side_validation: true, + required: false, + serialized_name: 'folder', + type: { + name: 'Composite', + class_name: 'DatasetFolder' + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'typeProperties.location', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DatasetLocation', + class_name: 'DatasetLocation' + } + }, + encoding_name: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.encodingName', + type: { + name: 'Object' + } + }, + null_value: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.nullValue', + type: { + name: 'Object' + } + }, + compression: { + client_side_validation: true, + required: false, + serialized_name: 'typeProperties.compression', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DatasetCompression', + class_name: 'DatasetCompression' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_read_settings.rb new file mode 100644 index 000000000..365e32164 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_read_settings.rb @@ -0,0 +1,107 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # Xml read settings. + # + class XmlReadSettings < FormatReadSettings + + include MsRestAzure + + + def initialize + @type = "XmlReadSettings" + end + + attr_accessor :type + + # @return [CompressionReadSettings] Compression settings. + attr_accessor :compression_properties + + # @return Indicates what validation method is used when reading the xml + # files. Allowed values: 'none', 'xsd', or 'dtd'. Type: string (or + # Expression with resultType string). + attr_accessor :validation_mode + + # @return Namespace uri to prefix mappings to override the prefixes in + # column names when namespace is enabled, if no prefix is defined for a + # namespace uri, the prefix of xml element/attribute name in the xml data + # file will be used. Example: "{"http://www.example.com/xml":"prefix"}" + # Type: object (or Expression with resultType object). + attr_accessor :namespace_prefixes + + + # + # Mapper for XmlReadSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'XmlReadSettings', + type: { + name: 'Composite', + class_name: 'XmlReadSettings', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + compression_properties: { + client_side_validation: true, + required: false, + serialized_name: 'compressionProperties', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'CompressionReadSettings', + class_name: 'CompressionReadSettings' + } + }, + validation_mode: { + client_side_validation: true, + required: false, + serialized_name: 'validationMode', + type: { + name: 'Object' + } + }, + namespace_prefixes: { + client_side_validation: true, + required: false, + serialized_name: 'namespacePrefixes', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_source.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_source.rb new file mode 100644 index 000000000..9d1d2aac4 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_source.rb @@ -0,0 +1,137 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # A copy activity Xml source. + # + class XmlSource < CopySource + + include MsRestAzure + + + def initialize + @type = "XmlSource" + end + + attr_accessor :type + + # @return [StoreReadSettings] Xml store settings. + attr_accessor :store_settings + + # @return [XmlReadSettings] Xml format settings. + attr_accessor :format_settings + + # @return [Array] Specifies the additional columns to + # be added to source data. Type: array of objects (or Expression with + # resultType array of objects). + attr_accessor :additional_columns + + + # + # Mapper for XmlSource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'XmlSource', + type: { + name: 'Composite', + class_name: 'XmlSource', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + source_retry_count: { + client_side_validation: true, + required: false, + serialized_name: 'sourceRetryCount', + type: { + name: 'Object' + } + }, + source_retry_wait: { + client_side_validation: true, + required: false, + serialized_name: 'sourceRetryWait', + type: { + name: 'Object' + } + }, + max_concurrent_connections: { + client_side_validation: true, + required: false, + serialized_name: 'maxConcurrentConnections', + type: { + name: 'Object' + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + store_settings: { + client_side_validation: true, + required: false, + serialized_name: 'storeSettings', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'StoreReadSettings', + class_name: 'StoreReadSettings' + } + }, + format_settings: { + client_side_validation: true, + required: false, + serialized_name: 'formatSettings', + type: { + name: 'Composite', + class_name: 'XmlReadSettings' + } + }, + additional_columns: { + client_side_validation: true, + required: false, + serialized_name: 'additionalColumns', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'AdditionalColumnsElementType', + type: { + name: 'Composite', + class_name: 'AdditionalColumns' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/zip_deflate_read_settings.rb b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/zip_deflate_read_settings.rb new file mode 100644 index 000000000..73b76b288 --- /dev/null +++ b/management/azure_mgmt_data_factory/lib/2018-06-01/generated/azure_mgmt_data_factory/models/zip_deflate_read_settings.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::DataFactory::Mgmt::V2018_06_01 + module Models + # + # The ZipDeflate compression read settings. + # + class ZipDeflateReadSettings < CompressionReadSettings + + include MsRestAzure + + + def initialize + @type = "ZipDeflateReadSettings" + end + + attr_accessor :type + + # @return Preserve the zip file name as folder path. Type: boolean (or + # Expression with resultType boolean). + attr_accessor :preserve_zip_file_name_as_folder + + + # + # Mapper for ZipDeflateReadSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ZipDeflateReadSettings', + type: { + name: 'Composite', + class_name: 'ZipDeflateReadSettings', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + preserve_zip_file_name_as_folder: { + client_side_validation: true, + required: false, + serialized_name: 'preserveZipFileNameAsFolder', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_data_factory/lib/profiles/latest/modules/datafactory_profile_module.rb b/management/azure_mgmt_data_factory/lib/profiles/latest/modules/datafactory_profile_module.rb index 771209ca1..b7c9ab26d 100644 --- a/management/azure_mgmt_data_factory/lib/profiles/latest/modules/datafactory_profile_module.rb +++ b/management/azure_mgmt_data_factory/lib/profiles/latest/modules/datafactory_profile_module.rb @@ -23,166 +23,172 @@ module Azure::DataFactory::Profiles::Latest DataFlowDebugSession = Azure::DataFactory::Mgmt::V2018_06_01::DataFlowDebugSession module Models - DataFlowDebugCommandResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandResponse - DataFlowDebugSessionInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugSessionInfo - SubResource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResource - QueryDataFlowDebugSessionsResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::QueryDataFlowDebugSessionsResponse - Expression = Azure::DataFactory::Mgmt::V2018_06_01::Models::Expression - GetDataFactoryOperationStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::GetDataFactoryOperationStatusResponse - LinkedServiceReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceReference - DataFlowReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowReference - SecretBase = Azure::DataFactory::Mgmt::V2018_06_01::Models::SecretBase - DataFlowDebugPackage = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackage - FactoryRepoConfiguration = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoConfiguration - AddDataFlowToDebugSessionResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::AddDataFlowToDebugSessionResponse - FactoryListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryListResponse - DeleteDataFlowDebugSessionRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::DeleteDataFlowDebugSessionRequest - DataFlowSourceSetting = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSourceSetting DataFlowStagingInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowStagingInfo - IntegrationRuntimeReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeReference - DWCopyCommandDefaultValue = Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandDefaultValue - IntegrationRuntimeStatus = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatus - DataFlowDebugPackageDebugSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackageDebugSettings - IntegrationRuntimeStatusListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusListResponse - UpdateIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeRequest - ScheduleTriggerRecurrence = Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTriggerRecurrence - LinkedIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeRequest - IntegrationRuntime = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntime - ParameterSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::ParameterSpecification - DWCopyCommandSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandSettings - SSISExecutionCredential = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionCredential - DataFlowDebugCommandPayload = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandPayload - DatasetFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetFolder - DataFlowDebugCommandRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandRequest - SSISChildPackage = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISChildPackage Resource = Azure::DataFactory::Mgmt::V2018_06_01::Models::Resource - ActivityDependency = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityDependency - SubResourceDebugResource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResourceDebugResource - Activity = Azure::DataFactory::Mgmt::V2018_06_01::Models::Activity - VariableSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::VariableSpecification - PipelineFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineFolder - RecurrenceSchedule = Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceSchedule - PipelineListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineListResponse - RecurrenceScheduleOccurrence = Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceScheduleOccurrence - SSISPackageLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPackageLocation - FactoryIdentity = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryIdentity - TriggerListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerListResponse - SSISAccessCredential = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISAccessCredential - WebActivityAuthentication = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivityAuthentication SkipErrorFile = Azure::DataFactory::Mgmt::V2018_06_01::Models::SkipErrorFile - Transformation = Azure::DataFactory::Mgmt::V2018_06_01::Models::Transformation - FactoryRepoUpdate = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoUpdate - CustomActivityReferenceObject = Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomActivityReferenceObject - GitHubAccessTokenResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenResponse - LogStorageSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::LogStorageSettings - AccessPolicyResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::AccessPolicyResponse - CopySource = Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySource - TriggerPipelineReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerPipelineReference - FormatReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatReadSettings - DatasetReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetReference - StoreReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreReadSettings - ExecuteDataFlowActivityTypePropertiesCompute = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivityTypePropertiesCompute - AdditionalColumns = Azure::DataFactory::Mgmt::V2018_06_01::Models::AdditionalColumns - RunQueryFilter = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryFilter - MongoDbCursorMethodsProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::MongoDbCursorMethodsProperties - RunFilterParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunFilterParameters - SapHanaPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapHanaPartitionSettings - PipelineRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRun - SapTablePartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTablePartitionSettings - ActivityRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRun - StoredProcedureParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameter - TriggerRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRun - ScriptAction = Azure::DataFactory::Mgmt::V2018_06_01::Models::ScriptAction - OperationDisplay = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationDisplay - TeradataPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionSettings - OperationMetricAvailability = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricAvailability - OraclePartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::OraclePartitionSettings - OperationMetricSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricSpecification - NetezzaPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::NetezzaPartitionSettings - Operation = Azure::DataFactory::Mgmt::V2018_06_01::Models::Operation - RedshiftUnloadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::RedshiftUnloadSettings - GetSsisObjectMetadataRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::GetSsisObjectMetadataRequest - DistcpSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DistcpSettings - ExposureControlRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlRequest - SSISLogLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISLogLocation - DataFlowFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowFolder - AzureMLWebServiceFile = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLWebServiceFile - ActivityPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityPolicy - SSISPropertyOverride = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPropertyOverride - CreateDataFlowDebugSessionRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionRequest - DatasetStorageFormat = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetStorageFormat - IntegrationRuntimeListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeListResponse - IntegrationRuntimeConnectionInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeConnectionInfo - IntegrationRuntimeStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusResponse - IntegrationRuntimeRegenerateKeyParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeRegenerateKeyParameters - CreateLinkedIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateLinkedIntegrationRuntimeRequest - IntegrationRuntimeAuthKeys = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeAuthKeys - LinkedServiceListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceListResponse - IntegrationRuntimeMonitoringData = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeMonitoringData - DatasetListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetListResponse - DatasetCompression = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetCompression - WebLinkedServiceTypeProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebLinkedServiceTypeProperties - IntegrationRuntimeNodeMonitoringData = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeMonitoringData - TriggerQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerQueryResponse - SsisObjectMetadataListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataListResponse - TriggerSubscriptionOperationStatus = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerSubscriptionOperationStatus - SsisObjectMetadata = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadata - GitHubAccessTokenRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenRequest - SsisEnvironmentReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisEnvironmentReference - PipelineReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineReference - SsisParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisParameter - StagingSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StagingSettings - SsisVariable = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisVariable - RunQueryOrderBy = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryOrderBy - IntegrationRuntimeNodeIpAddress = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeIpAddress - PipelineRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunsQueryResponse - IntegrationRuntimeComputeProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeComputeProperties - TriggerRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRunsQueryResponse - IntegrationRuntimeDataFlowProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataFlowProperties - OperationMetricDimension = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricDimension - IntegrationRuntimeVNetProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeVNetProperties - OperationListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationListResponse - IntegrationRuntimeSsisProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisProperties - ExposureControlResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlResponse - IntegrationRuntimeSsisCatalogInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisCatalogInfo - DataFlowListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowListResponse - DatasetLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetLocation - SSISExecutionParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionParameter - IntegrationRuntimeCustomSetupScriptProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeCustomSetupScriptProperties - LinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedService - IntegrationRuntimeDataProxyProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataProxyProperties - UserProperty = Azure::DataFactory::Mgmt::V2018_06_01::Models::UserProperty - EntityReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::EntityReference - CreateRunResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateRunResponse - CustomSetupBase = Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomSetupBase - UserAccessPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::UserAccessPolicy - LinkedIntegrationRuntimeType = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeType - TriggerFilterParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerFilterParameters - ManagedIntegrationRuntimeNode = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeNode - ActivityRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRunsQueryResponse - ManagedIntegrationRuntimeError = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeError - OperationServiceSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationServiceSpecification - ManagedIntegrationRuntimeOperationResult = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeOperationResult - DataFlow = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlow - SelfHostedIntegrationRuntimeNode = Azure::DataFactory::Mgmt::V2018_06_01::Models::SelfHostedIntegrationRuntimeNode - UpdateIntegrationRuntimeNodeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeNodeRequest - LinkedIntegrationRuntime = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntime - Trigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::Trigger - TriggerReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerReference - FactoryUpdateParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryUpdateParameters - SwitchCase = Azure::DataFactory::Mgmt::V2018_06_01::Models::SwitchCase - OperationLogSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationLogSpecification + SubResourceDebugResource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResourceDebugResource + DataFlowDebugPackageDebugSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackageDebugSettings CopySink = Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySink + DataFlowListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowListResponse + AzureMLWebServiceFile = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLWebServiceFile + CreateDataFlowDebugSessionRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionRequest + FactoryIdentity = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryIdentity CreateDataFlowDebugSessionResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionResponse - DependencyReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DependencyReference - RedirectIncompatibleRowSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::RedirectIncompatibleRowSettings - RetryPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::RetryPolicy - SsisObjectMetadataStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataStatusResponse - FormatWriteSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatWriteSettings - PipelineRunInvokedBy = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunInvokedBy - StoreWriteSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreWriteSettings + GlobalParameterSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::GlobalParameterSpecification + DataFlowSourceSetting = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSourceSetting + FactoryListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryListResponse + SubResource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResource + StagingSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StagingSettings + Expression = Azure::DataFactory::Mgmt::V2018_06_01::Models::Expression + IntegrationRuntimeReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeReference + SwitchCase = Azure::DataFactory::Mgmt::V2018_06_01::Models::SwitchCase + IntegrationRuntimeStatus = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatus + DataFlowDebugPackage = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackage + IntegrationRuntimeStatusListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusListResponse + AddDataFlowToDebugSessionResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::AddDataFlowToDebugSessionResponse + UpdateIntegrationRuntimeNodeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeNodeRequest + DeleteDataFlowDebugSessionRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::DeleteDataFlowDebugSessionRequest + CreateLinkedIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateLinkedIntegrationRuntimeRequest + DataFlowDebugCommandPayload = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandPayload + LinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedService + DataFlowDebugCommandRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandRequest + LinkedServiceListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceListResponse + DataFlowDebugCommandResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandResponse Dataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::Dataset + DataFlowDebugSessionInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugSessionInfo + DatasetListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetListResponse + QueryDataFlowDebugSessionsResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::QueryDataFlowDebugSessionsResponse + UserProperty = Azure::DataFactory::Mgmt::V2018_06_01::Models::UserProperty + GetDataFactoryOperationStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::GetDataFactoryOperationStatusResponse + VariableSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::VariableSpecification + DataFlowReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowReference + DWCopyCommandSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandSettings + SSISPropertyOverride = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPropertyOverride + Trigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::Trigger + FormatReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatReadSettings + TriggerQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerQueryResponse + Transformation = Azure::DataFactory::Mgmt::V2018_06_01::Models::Transformation + CreateRunResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateRunResponse + DistcpSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DistcpSettings + TriggerSubscriptionOperationStatus = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerSubscriptionOperationStatus + SSISLogLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISLogLocation + FormatWriteSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatWriteSettings + SSISAccessCredential = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISAccessCredential + GitHubAccessTokenRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenRequest + CustomActivityReferenceObject = Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomActivityReferenceObject + UserAccessPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::UserAccessPolicy + LogStorageSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::LogStorageSettings + PipelineReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineReference + CopySource = Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySource + FactoryUpdateParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryUpdateParameters + SapHanaPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapHanaPartitionSettings + ExecuteDataFlowActivityTypePropertiesCompute = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivityTypePropertiesCompute + SapTablePartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTablePartitionSettings + TriggerFilterParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerFilterParameters + StoredProcedureParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameter + RunQueryOrderBy = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryOrderBy + SqlPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlPartitionSettings + PipelineRunInvokedBy = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunInvokedBy + TeradataPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionSettings + PipelineRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunsQueryResponse + NetezzaPartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::NetezzaPartitionSettings + ActivityRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRunsQueryResponse + ScriptAction = Azure::DataFactory::Mgmt::V2018_06_01::Models::ScriptAction + TriggerRunsQueryResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRunsQueryResponse + StoreReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreReadSettings + OperationLogSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationLogSpecification + RedshiftUnloadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::RedshiftUnloadSettings + OperationMetricDimension = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricDimension + WebActivityAuthentication = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivityAuthentication + OperationServiceSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationServiceSpecification + OraclePartitionSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::OraclePartitionSettings + OperationListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationListResponse + MongoDbCursorMethodsProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::MongoDbCursorMethodsProperties + SsisObjectMetadataStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataStatusResponse + ExportSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExportSettings + ExposureControlResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlResponse + AdditionalColumns = Azure::DataFactory::Mgmt::V2018_06_01::Models::AdditionalColumns + DataFlow = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlow + SSISExecutionParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionParameter + SecretBase = Azure::DataFactory::Mgmt::V2018_06_01::Models::SecretBase + SSISExecutionCredential = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionCredential + RedirectIncompatibleRowSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::RedirectIncompatibleRowSettings + SSISChildPackage = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISChildPackage + IntegrationRuntimeListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeListResponse + CompressionReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::CompressionReadSettings + IntegrationRuntimeStatusResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusResponse + SSISPackageLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPackageLocation + LinkedIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeRequest + IntegrationRuntimeConnectionInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeConnectionInfo + DWCopyCommandDefaultValue = Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandDefaultValue + IntegrationRuntimeRegenerateKeyParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeRegenerateKeyParameters + WebLinkedServiceTypeProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebLinkedServiceTypeProperties + IntegrationRuntimeAuthKeys = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeAuthKeys + Activity = Azure::DataFactory::Mgmt::V2018_06_01::Models::Activity + IntegrationRuntimeMonitoringData = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeMonitoringData + PipelineListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineListResponse + IntegrationRuntimeNodeMonitoringData = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeMonitoringData + TriggerListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerListResponse + SsisObjectMetadataListResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataListResponse + StoreWriteSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreWriteSettings + SsisObjectMetadata = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadata + GitHubAccessTokenResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenResponse + DatasetStorageFormat = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetStorageFormat + TriggerPipelineReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerPipelineReference + SsisEnvironmentReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisEnvironmentReference + ActivityPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityPolicy + SsisParameter = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisParameter + RunFilterParameters = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunFilterParameters + SsisVariable = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisVariable + ActivityRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRun + DatasetLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetLocation + OperationDisplay = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationDisplay + IntegrationRuntimeNodeIpAddress = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeIpAddress + OperationMetricSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricSpecification + DatasetCompression = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetCompression + GetSsisObjectMetadataRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::GetSsisObjectMetadataRequest + IntegrationRuntimeComputeProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeComputeProperties + DataFlowFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowFolder + IntegrationRuntimeDataFlowProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataFlowProperties + FactoryRepoConfiguration = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoConfiguration + IntegrationRuntimeVNetProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeVNetProperties + ImportSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::ImportSettings + IntegrationRuntimeSsisProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisProperties + ParameterSpecification = Azure::DataFactory::Mgmt::V2018_06_01::Models::ParameterSpecification + IntegrationRuntimeSsisCatalogInfo = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisCatalogInfo + ActivityDependency = Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityDependency + IntegrationRuntimeCustomSetupScriptProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeCustomSetupScriptProperties PolybaseSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::PolybaseSettings + IntegrationRuntimeDataProxyProperties = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataProxyProperties + FactoryRepoUpdate = Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoUpdate + CustomSetupBase = Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomSetupBase + DatasetReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetReference + PackageStore = Azure::DataFactory::Mgmt::V2018_06_01::Models::PackageStore + PipelineRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRun + EntityReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::EntityReference + OperationMetricAvailability = Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricAvailability + LinkedIntegrationRuntimeType = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeType + ExposureControlRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlRequest + TriggerReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerReference + IntegrationRuntime = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntime + ManagedIntegrationRuntimeNode = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeNode + DatasetFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetFolder + ManagedIntegrationRuntimeError = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeError + DependencyReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::DependencyReference + RunQueryFilter = Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryFilter + RetryPolicy = Azure::DataFactory::Mgmt::V2018_06_01::Models::RetryPolicy + Operation = Azure::DataFactory::Mgmt::V2018_06_01::Models::Operation + ManagedIntegrationRuntimeOperationResult = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeOperationResult + UpdateIntegrationRuntimeRequest = Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeRequest + SelfHostedIntegrationRuntimeNode = Azure::DataFactory::Mgmt::V2018_06_01::Models::SelfHostedIntegrationRuntimeNode + AccessPolicyResponse = Azure::DataFactory::Mgmt::V2018_06_01::Models::AccessPolicyResponse + LinkedIntegrationRuntime = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntime + LinkedServiceReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceReference + RecurrenceScheduleOccurrence = Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceScheduleOccurrence + TriggerRun = Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRun + RecurrenceSchedule = Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceSchedule + PipelineFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineFolder + ScheduleTriggerRecurrence = Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTriggerRecurrence SecureString = Azure::DataFactory::Mgmt::V2018_06_01::Models::SecureString AzureKeyVaultSecretReference = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureKeyVaultSecretReference Factory = Azure::DataFactory::Mgmt::V2018_06_01::Models::Factory @@ -201,6 +207,8 @@ module Azure::DataFactory::Profiles::Latest DataFlowSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSink DataFlowSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSource MappingDataFlow = Azure::DataFactory::Mgmt::V2018_06_01::Models::MappingDataFlow + SharePointOnlineListLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListLinkedService + SnowflakeLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeLinkedService AzureFunctionLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFunctionLinkedService AzureDataExplorerLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataExplorerLinkedService SapTableLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTableLinkedService @@ -298,6 +306,8 @@ module Azure::DataFactory::Profiles::Latest AzureTableStorageLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureTableStorageLinkedService AzureBlobStorageLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageLinkedService AzureStorageLinkedService = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureStorageLinkedService + SharePointOnlineListResourceDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListResourceDataset + SnowflakeDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeDataset GoogleAdWordsObjectDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleAdWordsObjectDataset AzureDataExplorerTableDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataExplorerTableDataset OracleServiceCloudObjectDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::OracleServiceCloudObjectDataset @@ -400,9 +410,11 @@ module Azure::DataFactory::Profiles::Latest AzureBlobStorageLocation = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageLocation BinaryDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::BinaryDataset OrcDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::OrcDataset + XmlDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlDataset JsonDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonDataset DelimitedTextDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextDataset ParquetDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::ParquetDataset + ExcelDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExcelDataset AvroDataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::AvroDataset AmazonS3Dataset = Azure::DataFactory::Mgmt::V2018_06_01::Models::AmazonS3Dataset ChainingTrigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::ChainingTrigger @@ -415,7 +427,6 @@ module Azure::DataFactory::Profiles::Latest BlobEventsTrigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::BlobEventsTrigger BlobTrigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::BlobTrigger ScheduleTrigger = Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTrigger - ExecutionActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecutionActivity ExecuteDataFlowActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivity AzureFunctionActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFunctionActivity DatabricksSparkPythonActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::DatabricksSparkPythonActivity @@ -425,8 +436,27 @@ module Azure::DataFactory::Profiles::Latest AzureMLExecutePipelineActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLExecutePipelineActivity AzureMLUpdateResourceActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLUpdateResourceActivity AzureMLBatchExecutionActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLBatchExecutionActivity + ZipDeflateReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::ZipDeflateReadSettings + BinaryReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::BinaryReadSettings + XmlReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlReadSettings + JsonReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonReadSettings + DelimitedTextReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextReadSettings + HdfsReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::HdfsReadSettings + HttpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpReadSettings + SftpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SftpReadSettings + FtpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FtpReadSettings + GoogleCloudStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleCloudStorageReadSettings + AzureFileStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFileStorageReadSettings + FileServerReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FileServerReadSettings + AmazonS3ReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AmazonS3ReadSettings + AzureDataLakeStoreReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreReadSettings + AzureBlobFSReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSReadSettings + AzureBlobStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageReadSettings GetMetadataActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::GetMetadataActivity WebActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivity + SharePointOnlineListSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListSource + SnowflakeExportCopyCommand = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeExportCopyCommand + SnowflakeSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeSource HttpSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpSource AzureBlobFSSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSSource AzureDataLakeStoreSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreSource @@ -508,23 +538,13 @@ module Azure::DataFactory::Profiles::Latest Db2Source = Azure::DataFactory::Mgmt::V2018_06_01::Models::Db2Source InformixSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::InformixSource AzureTableSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureTableSource - HdfsReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::HdfsReadSettings - HttpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpReadSettings - SftpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::SftpReadSettings - FtpReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FtpReadSettings - GoogleCloudStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleCloudStorageReadSettings - AzureFileStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFileStorageReadSettings - FileServerReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::FileServerReadSettings - AmazonS3ReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AmazonS3ReadSettings - AzureDataLakeStoreReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreReadSettings - AzureBlobFSReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSReadSettings - AzureBlobStorageReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageReadSettings BinarySource = Azure::DataFactory::Mgmt::V2018_06_01::Models::BinarySource OrcSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::OrcSource + XmlSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlSource JsonSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonSource - DelimitedTextReadSettings = Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextReadSettings DelimitedTextSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextSource ParquetSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::ParquetSource + ExcelSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExcelSource AvroSource = Azure::DataFactory::Mgmt::V2018_06_01::Models::AvroSource LookupActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::LookupActivity AzureDataExplorerCommandActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataExplorerCommandActivity @@ -551,6 +571,8 @@ module Azure::DataFactory::Profiles::Latest AzureBlobFSSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSSink AzureDataLakeStoreSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreSink OracleSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::OracleSink + SnowflakeImportCopyCommand = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeImportCopyCommand + SnowflakeSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeSink SqlDWSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlDWSink SqlMISink = Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlMISink AzureSqlSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureSqlSink @@ -579,6 +601,7 @@ module Azure::DataFactory::Profiles::Latest OrcSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::OrcSink JsonSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonSink DelimitedTextSink = Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextSink + ExecutionActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecutionActivity CopyActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::CopyActivity ControlActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::ControlActivity WebHookActivity = Azure::DataFactory::Mgmt::V2018_06_01::Models::WebHookActivity @@ -605,6 +628,7 @@ module Azure::DataFactory::Profiles::Latest SsisPackage = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisPackage SsisProject = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisProject SsisFolder = Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisFolder + GlobalParameterType = Azure::DataFactory::Mgmt::V2018_06_01::Models::GlobalParameterType IntegrationRuntimeState = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeState IntegrationRuntimeAutoUpdate = Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeAutoUpdate ParameterType = Azure::DataFactory::Mgmt::V2018_06_01::Models::ParameterType @@ -659,6 +683,7 @@ module Azure::DataFactory::Profiles::Latest NetezzaPartitionOption = Azure::DataFactory::Mgmt::V2018_06_01::Models::NetezzaPartitionOption CassandraSourceReadConsistencyLevels = Azure::DataFactory::Mgmt::V2018_06_01::Models::CassandraSourceReadConsistencyLevels TeradataPartitionOption = Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionOption + SqlPartitionOption = Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlPartitionOption StoredProcedureParameterType = Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameterType SapTablePartitionOption = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTablePartitionOption SapHanaPartitionOption = Azure::DataFactory::Mgmt::V2018_06_01::Models::SapHanaPartitionOption @@ -742,486 +767,504 @@ module Azure::DataFactory::Profiles::Latest end class ModelClasses - def data_flow_debug_command_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandResponse - end - def data_flow_debug_session_info - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugSessionInfo - end - def sub_resource - Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResource - end - def query_data_flow_debug_sessions_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::QueryDataFlowDebugSessionsResponse - end - def expression - Azure::DataFactory::Mgmt::V2018_06_01::Models::Expression - end - def get_data_factory_operation_status_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::GetDataFactoryOperationStatusResponse - end - def linked_service_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceReference - end - def data_flow_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowReference - end - def secret_base - Azure::DataFactory::Mgmt::V2018_06_01::Models::SecretBase - end - def data_flow_debug_package - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackage - end - def factory_repo_configuration - Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoConfiguration - end - def add_data_flow_to_debug_session_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::AddDataFlowToDebugSessionResponse - end - def factory_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryListResponse - end - def delete_data_flow_debug_session_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::DeleteDataFlowDebugSessionRequest - end - def data_flow_source_setting - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSourceSetting - end def data_flow_staging_info Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowStagingInfo end - def integration_runtime_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeReference - end - def dwcopy_command_default_value - Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandDefaultValue - end - def integration_runtime_status - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatus - end - def data_flow_debug_package_debug_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackageDebugSettings - end - def integration_runtime_status_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusListResponse - end - def update_integration_runtime_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeRequest - end - def schedule_trigger_recurrence - Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTriggerRecurrence - end - def linked_integration_runtime_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeRequest - end - def integration_runtime - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntime - end - def parameter_specification - Azure::DataFactory::Mgmt::V2018_06_01::Models::ParameterSpecification - end - def dwcopy_command_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandSettings - end - def ssisexecution_credential - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionCredential - end - def data_flow_debug_command_payload - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandPayload - end - def dataset_folder - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetFolder - end - def data_flow_debug_command_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandRequest - end - def ssischild_package - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISChildPackage - end def resource Azure::DataFactory::Mgmt::V2018_06_01::Models::Resource end - def activity_dependency - Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityDependency + def skip_error_file + Azure::DataFactory::Mgmt::V2018_06_01::Models::SkipErrorFile end def sub_resource_debug_resource Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResourceDebugResource end - def activity - Azure::DataFactory::Mgmt::V2018_06_01::Models::Activity - end - def variable_specification - Azure::DataFactory::Mgmt::V2018_06_01::Models::VariableSpecification - end - def pipeline_folder - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineFolder - end - def recurrence_schedule - Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceSchedule - end - def pipeline_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineListResponse - end - def recurrence_schedule_occurrence - Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceScheduleOccurrence - end - def ssispackage_location - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPackageLocation - end - def factory_identity - Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryIdentity - end - def trigger_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerListResponse - end - def ssisaccess_credential - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISAccessCredential - end - def web_activity_authentication - Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivityAuthentication - end - def skip_error_file - Azure::DataFactory::Mgmt::V2018_06_01::Models::SkipErrorFile - end - def transformation - Azure::DataFactory::Mgmt::V2018_06_01::Models::Transformation - end - def factory_repo_update - Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoUpdate - end - def custom_activity_reference_object - Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomActivityReferenceObject - end - def git_hub_access_token_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenResponse - end - def log_storage_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::LogStorageSettings - end - def access_policy_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::AccessPolicyResponse - end - def copy_source - Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySource - end - def trigger_pipeline_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerPipelineReference - end - def format_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatReadSettings - end - def dataset_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetReference - end - def store_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreReadSettings - end - def execute_data_flow_activity_type_properties_compute - Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivityTypePropertiesCompute - end - def additional_columns - Azure::DataFactory::Mgmt::V2018_06_01::Models::AdditionalColumns - end - def run_query_filter - Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryFilter - end - def mongo_db_cursor_methods_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::MongoDbCursorMethodsProperties - end - def run_filter_parameters - Azure::DataFactory::Mgmt::V2018_06_01::Models::RunFilterParameters - end - def sap_hana_partition_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::SapHanaPartitionSettings - end - def pipeline_run - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRun - end - def sap_table_partition_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTablePartitionSettings - end - def activity_run - Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRun - end - def stored_procedure_parameter - Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameter - end - def trigger_run - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRun - end - def script_action - Azure::DataFactory::Mgmt::V2018_06_01::Models::ScriptAction - end - def operation_display - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationDisplay - end - def teradata_partition_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionSettings - end - def operation_metric_availability - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricAvailability - end - def oracle_partition_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::OraclePartitionSettings - end - def operation_metric_specification - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricSpecification - end - def netezza_partition_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::NetezzaPartitionSettings - end - def operation - Azure::DataFactory::Mgmt::V2018_06_01::Models::Operation - end - def redshift_unload_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::RedshiftUnloadSettings - end - def get_ssis_object_metadata_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::GetSsisObjectMetadataRequest - end - def distcp_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::DistcpSettings - end - def exposure_control_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlRequest - end - def ssislog_location - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISLogLocation - end - def data_flow_folder - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowFolder - end - def azure_mlweb_service_file - Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLWebServiceFile - end - def activity_policy - Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityPolicy - end - def ssisproperty_override - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPropertyOverride - end - def create_data_flow_debug_session_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionRequest - end - def dataset_storage_format - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetStorageFormat - end - def integration_runtime_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeListResponse - end - def integration_runtime_connection_info - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeConnectionInfo - end - def integration_runtime_status_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusResponse - end - def integration_runtime_regenerate_key_parameters - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeRegenerateKeyParameters - end - def create_linked_integration_runtime_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateLinkedIntegrationRuntimeRequest - end - def integration_runtime_auth_keys - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeAuthKeys - end - def linked_service_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceListResponse - end - def integration_runtime_monitoring_data - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeMonitoringData - end - def dataset_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetListResponse - end - def dataset_compression - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetCompression - end - def web_linked_service_type_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::WebLinkedServiceTypeProperties - end - def integration_runtime_node_monitoring_data - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeMonitoringData - end - def trigger_query_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerQueryResponse - end - def ssis_object_metadata_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataListResponse - end - def trigger_subscription_operation_status - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerSubscriptionOperationStatus - end - def ssis_object_metadata - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadata - end - def git_hub_access_token_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenRequest - end - def ssis_environment_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisEnvironmentReference - end - def pipeline_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineReference - end - def ssis_parameter - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisParameter - end - def staging_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::StagingSettings - end - def ssis_variable - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisVariable - end - def run_query_order_by - Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryOrderBy - end - def integration_runtime_node_ip_address - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeIpAddress - end - def pipeline_runs_query_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunsQueryResponse - end - def integration_runtime_compute_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeComputeProperties - end - def trigger_runs_query_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRunsQueryResponse - end - def integration_runtime_data_flow_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataFlowProperties - end - def operation_metric_dimension - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricDimension - end - def integration_runtime_vnet_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeVNetProperties - end - def operation_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationListResponse - end - def integration_runtime_ssis_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisProperties - end - def exposure_control_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlResponse - end - def integration_runtime_ssis_catalog_info - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisCatalogInfo - end - def data_flow_list_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowListResponse - end - def dataset_location - Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetLocation - end - def ssisexecution_parameter - Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionParameter - end - def integration_runtime_custom_setup_script_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeCustomSetupScriptProperties - end - def linked_service - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedService - end - def integration_runtime_data_proxy_properties - Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataProxyProperties - end - def user_property - Azure::DataFactory::Mgmt::V2018_06_01::Models::UserProperty - end - def entity_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::EntityReference - end - def create_run_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateRunResponse - end - def custom_setup_base - Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomSetupBase - end - def user_access_policy - Azure::DataFactory::Mgmt::V2018_06_01::Models::UserAccessPolicy - end - def linked_integration_runtime_type - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeType - end - def trigger_filter_parameters - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerFilterParameters - end - def managed_integration_runtime_node - Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeNode - end - def activity_runs_query_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRunsQueryResponse - end - def managed_integration_runtime_error - Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeError - end - def operation_service_specification - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationServiceSpecification - end - def managed_integration_runtime_operation_result - Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeOperationResult - end - def data_flow - Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlow - end - def self_hosted_integration_runtime_node - Azure::DataFactory::Mgmt::V2018_06_01::Models::SelfHostedIntegrationRuntimeNode - end - def update_integration_runtime_node_request - Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeNodeRequest - end - def linked_integration_runtime - Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntime - end - def trigger - Azure::DataFactory::Mgmt::V2018_06_01::Models::Trigger - end - def trigger_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerReference - end - def factory_update_parameters - Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryUpdateParameters - end - def switch_case - Azure::DataFactory::Mgmt::V2018_06_01::Models::SwitchCase - end - def operation_log_specification - Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationLogSpecification + def data_flow_debug_package_debug_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackageDebugSettings end def copy_sink Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySink end + def data_flow_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowListResponse + end + def azure_mlweb_service_file + Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLWebServiceFile + end + def create_data_flow_debug_session_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionRequest + end + def factory_identity + Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryIdentity + end def create_data_flow_debug_session_response Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionResponse end - def dependency_reference - Azure::DataFactory::Mgmt::V2018_06_01::Models::DependencyReference + def global_parameter_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::GlobalParameterSpecification end - def redirect_incompatible_row_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::RedirectIncompatibleRowSettings + def data_flow_source_setting + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowSourceSetting end - def retry_policy - Azure::DataFactory::Mgmt::V2018_06_01::Models::RetryPolicy + def factory_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryListResponse end - def ssis_object_metadata_status_response - Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataStatusResponse + def sub_resource + Azure::DataFactory::Mgmt::V2018_06_01::Models::SubResource end - def format_write_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatWriteSettings + def staging_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::StagingSettings end - def pipeline_run_invoked_by - Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunInvokedBy + def expression + Azure::DataFactory::Mgmt::V2018_06_01::Models::Expression end - def store_write_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreWriteSettings + def integration_runtime_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeReference + end + def switch_case + Azure::DataFactory::Mgmt::V2018_06_01::Models::SwitchCase + end + def integration_runtime_status + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatus + end + def data_flow_debug_package + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackage + end + def integration_runtime_status_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusListResponse + end + def add_data_flow_to_debug_session_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::AddDataFlowToDebugSessionResponse + end + def update_integration_runtime_node_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeNodeRequest + end + def delete_data_flow_debug_session_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::DeleteDataFlowDebugSessionRequest + end + def create_linked_integration_runtime_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateLinkedIntegrationRuntimeRequest + end + def data_flow_debug_command_payload + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandPayload + end + def linked_service + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedService + end + def data_flow_debug_command_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandRequest + end + def linked_service_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceListResponse + end + def data_flow_debug_command_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandResponse end def dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::Dataset end + def data_flow_debug_session_info + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugSessionInfo + end + def dataset_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetListResponse + end + def query_data_flow_debug_sessions_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::QueryDataFlowDebugSessionsResponse + end + def user_property + Azure::DataFactory::Mgmt::V2018_06_01::Models::UserProperty + end + def get_data_factory_operation_status_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::GetDataFactoryOperationStatusResponse + end + def variable_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::VariableSpecification + end + def data_flow_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowReference + end + def dwcopy_command_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandSettings + end + def ssisproperty_override + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPropertyOverride + end + def trigger + Azure::DataFactory::Mgmt::V2018_06_01::Models::Trigger + end + def format_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatReadSettings + end + def trigger_query_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerQueryResponse + end + def transformation + Azure::DataFactory::Mgmt::V2018_06_01::Models::Transformation + end + def create_run_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateRunResponse + end + def distcp_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::DistcpSettings + end + def trigger_subscription_operation_status + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerSubscriptionOperationStatus + end + def ssislog_location + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISLogLocation + end + def format_write_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::FormatWriteSettings + end + def ssisaccess_credential + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISAccessCredential + end + def git_hub_access_token_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenRequest + end + def custom_activity_reference_object + Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomActivityReferenceObject + end + def user_access_policy + Azure::DataFactory::Mgmt::V2018_06_01::Models::UserAccessPolicy + end + def log_storage_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::LogStorageSettings + end + def pipeline_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineReference + end + def copy_source + Azure::DataFactory::Mgmt::V2018_06_01::Models::CopySource + end + def factory_update_parameters + Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryUpdateParameters + end + def sap_hana_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::SapHanaPartitionSettings + end + def execute_data_flow_activity_type_properties_compute + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivityTypePropertiesCompute + end + def sap_table_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::SapTablePartitionSettings + end + def trigger_filter_parameters + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerFilterParameters + end + def stored_procedure_parameter + Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameter + end + def run_query_order_by + Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryOrderBy + end + def sql_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlPartitionSettings + end + def pipeline_run_invoked_by + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunInvokedBy + end + def teradata_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionSettings + end + def pipeline_runs_query_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRunsQueryResponse + end + def netezza_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::NetezzaPartitionSettings + end + def activity_runs_query_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRunsQueryResponse + end + def script_action + Azure::DataFactory::Mgmt::V2018_06_01::Models::ScriptAction + end + def trigger_runs_query_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRunsQueryResponse + end + def store_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreReadSettings + end + def operation_log_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationLogSpecification + end + def redshift_unload_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::RedshiftUnloadSettings + end + def operation_metric_dimension + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricDimension + end + def web_activity_authentication + Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivityAuthentication + end + def operation_service_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationServiceSpecification + end + def oracle_partition_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::OraclePartitionSettings + end + def operation_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationListResponse + end + def mongo_db_cursor_methods_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::MongoDbCursorMethodsProperties + end + def ssis_object_metadata_status_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataStatusResponse + end + def export_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExportSettings + end + def exposure_control_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlResponse + end + def additional_columns + Azure::DataFactory::Mgmt::V2018_06_01::Models::AdditionalColumns + end + def data_flow + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlow + end + def ssisexecution_parameter + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionParameter + end + def secret_base + Azure::DataFactory::Mgmt::V2018_06_01::Models::SecretBase + end + def ssisexecution_credential + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISExecutionCredential + end + def redirect_incompatible_row_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::RedirectIncompatibleRowSettings + end + def ssischild_package + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISChildPackage + end + def integration_runtime_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeListResponse + end + def compression_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::CompressionReadSettings + end + def integration_runtime_status_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeStatusResponse + end + def ssispackage_location + Azure::DataFactory::Mgmt::V2018_06_01::Models::SSISPackageLocation + end + def linked_integration_runtime_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeRequest + end + def integration_runtime_connection_info + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeConnectionInfo + end + def dwcopy_command_default_value + Azure::DataFactory::Mgmt::V2018_06_01::Models::DWCopyCommandDefaultValue + end + def integration_runtime_regenerate_key_parameters + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeRegenerateKeyParameters + end + def web_linked_service_type_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::WebLinkedServiceTypeProperties + end + def integration_runtime_auth_keys + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeAuthKeys + end + def activity + Azure::DataFactory::Mgmt::V2018_06_01::Models::Activity + end + def integration_runtime_monitoring_data + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeMonitoringData + end + def pipeline_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineListResponse + end + def integration_runtime_node_monitoring_data + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeMonitoringData + end + def trigger_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerListResponse + end + def ssis_object_metadata_list_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadataListResponse + end + def store_write_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::StoreWriteSettings + end + def ssis_object_metadata + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisObjectMetadata + end + def git_hub_access_token_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::GitHubAccessTokenResponse + end + def dataset_storage_format + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetStorageFormat + end + def trigger_pipeline_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerPipelineReference + end + def ssis_environment_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisEnvironmentReference + end + def activity_policy + Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityPolicy + end + def ssis_parameter + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisParameter + end + def run_filter_parameters + Azure::DataFactory::Mgmt::V2018_06_01::Models::RunFilterParameters + end + def ssis_variable + Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisVariable + end + def activity_run + Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityRun + end + def dataset_location + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetLocation + end + def operation_display + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationDisplay + end + def integration_runtime_node_ip_address + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeNodeIpAddress + end + def operation_metric_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricSpecification + end + def dataset_compression + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetCompression + end + def get_ssis_object_metadata_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::GetSsisObjectMetadataRequest + end + def integration_runtime_compute_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeComputeProperties + end + def data_flow_folder + Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowFolder + end + def integration_runtime_data_flow_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataFlowProperties + end + def factory_repo_configuration + Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoConfiguration + end + def integration_runtime_vnet_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeVNetProperties + end + def import_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::ImportSettings + end + def integration_runtime_ssis_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisProperties + end + def parameter_specification + Azure::DataFactory::Mgmt::V2018_06_01::Models::ParameterSpecification + end + def integration_runtime_ssis_catalog_info + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeSsisCatalogInfo + end + def activity_dependency + Azure::DataFactory::Mgmt::V2018_06_01::Models::ActivityDependency + end + def integration_runtime_custom_setup_script_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeCustomSetupScriptProperties + end def polybase_settings Azure::DataFactory::Mgmt::V2018_06_01::Models::PolybaseSettings end + def integration_runtime_data_proxy_properties + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeDataProxyProperties + end + def factory_repo_update + Azure::DataFactory::Mgmt::V2018_06_01::Models::FactoryRepoUpdate + end + def custom_setup_base + Azure::DataFactory::Mgmt::V2018_06_01::Models::CustomSetupBase + end + def dataset_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetReference + end + def package_store + Azure::DataFactory::Mgmt::V2018_06_01::Models::PackageStore + end + def pipeline_run + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineRun + end + def entity_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::EntityReference + end + def operation_metric_availability + Azure::DataFactory::Mgmt::V2018_06_01::Models::OperationMetricAvailability + end + def linked_integration_runtime_type + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntimeType + end + def exposure_control_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExposureControlRequest + end + def trigger_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerReference + end + def integration_runtime + Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntime + end + def managed_integration_runtime_node + Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeNode + end + def dataset_folder + Azure::DataFactory::Mgmt::V2018_06_01::Models::DatasetFolder + end + def managed_integration_runtime_error + Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeError + end + def dependency_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::DependencyReference + end + def run_query_filter + Azure::DataFactory::Mgmt::V2018_06_01::Models::RunQueryFilter + end + def retry_policy + Azure::DataFactory::Mgmt::V2018_06_01::Models::RetryPolicy + end + def operation + Azure::DataFactory::Mgmt::V2018_06_01::Models::Operation + end + def managed_integration_runtime_operation_result + Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedIntegrationRuntimeOperationResult + end + def update_integration_runtime_request + Azure::DataFactory::Mgmt::V2018_06_01::Models::UpdateIntegrationRuntimeRequest + end + def self_hosted_integration_runtime_node + Azure::DataFactory::Mgmt::V2018_06_01::Models::SelfHostedIntegrationRuntimeNode + end + def access_policy_response + Azure::DataFactory::Mgmt::V2018_06_01::Models::AccessPolicyResponse + end + def linked_integration_runtime + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedIntegrationRuntime + end + def linked_service_reference + Azure::DataFactory::Mgmt::V2018_06_01::Models::LinkedServiceReference + end + def recurrence_schedule_occurrence + Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceScheduleOccurrence + end + def trigger_run + Azure::DataFactory::Mgmt::V2018_06_01::Models::TriggerRun + end + def recurrence_schedule + Azure::DataFactory::Mgmt::V2018_06_01::Models::RecurrenceSchedule + end + def pipeline_folder + Azure::DataFactory::Mgmt::V2018_06_01::Models::PipelineFolder + end + def schedule_trigger_recurrence + Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTriggerRecurrence + end def secure_string Azure::DataFactory::Mgmt::V2018_06_01::Models::SecureString end @@ -1276,6 +1319,12 @@ module Azure::DataFactory::Profiles::Latest def mapping_data_flow Azure::DataFactory::Mgmt::V2018_06_01::Models::MappingDataFlow end + def share_point_online_list_linked_service + Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListLinkedService + end + def snowflake_linked_service + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeLinkedService + end def azure_function_linked_service Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFunctionLinkedService end @@ -1567,6 +1616,12 @@ module Azure::DataFactory::Profiles::Latest def azure_storage_linked_service Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureStorageLinkedService end + def share_point_online_list_resource_dataset + Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListResourceDataset + end + def snowflake_dataset + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeDataset + end def google_ad_words_object_dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleAdWordsObjectDataset end @@ -1873,6 +1928,9 @@ module Azure::DataFactory::Profiles::Latest def orc_dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::OrcDataset end + def xml_dataset + Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlDataset + end def json_dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonDataset end @@ -1882,6 +1940,9 @@ module Azure::DataFactory::Profiles::Latest def parquet_dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::ParquetDataset end + def excel_dataset + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExcelDataset + end def avro_dataset Azure::DataFactory::Mgmt::V2018_06_01::Models::AvroDataset end @@ -1918,9 +1979,6 @@ module Azure::DataFactory::Profiles::Latest def schedule_trigger Azure::DataFactory::Mgmt::V2018_06_01::Models::ScheduleTrigger end - def execution_activity - Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecutionActivity - end def execute_data_flow_activity Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecuteDataFlowActivity end @@ -1948,12 +2006,69 @@ module Azure::DataFactory::Profiles::Latest def azure_mlbatch_execution_activity Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureMLBatchExecutionActivity end + def zip_deflate_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::ZipDeflateReadSettings + end + def binary_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::BinaryReadSettings + end + def xml_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlReadSettings + end + def json_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonReadSettings + end + def delimited_text_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextReadSettings + end + def hdfs_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::HdfsReadSettings + end + def http_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpReadSettings + end + def sftp_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::SftpReadSettings + end + def ftp_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::FtpReadSettings + end + def google_cloud_storage_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleCloudStorageReadSettings + end + def azure_file_storage_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFileStorageReadSettings + end + def file_server_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::FileServerReadSettings + end + def amazon_s3_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::AmazonS3ReadSettings + end + def azure_data_lake_store_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreReadSettings + end + def azure_blob_fsread_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSReadSettings + end + def azure_blob_storage_read_settings + Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageReadSettings + end def get_metadata_activity Azure::DataFactory::Mgmt::V2018_06_01::Models::GetMetadataActivity end def web_activity Azure::DataFactory::Mgmt::V2018_06_01::Models::WebActivity end + def share_point_online_list_source + Azure::DataFactory::Mgmt::V2018_06_01::Models::SharePointOnlineListSource + end + def snowflake_export_copy_command + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeExportCopyCommand + end + def snowflake_source + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeSource + end def http_source Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpSource end @@ -2197,57 +2312,27 @@ module Azure::DataFactory::Profiles::Latest def azure_table_source Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureTableSource end - def hdfs_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::HdfsReadSettings - end - def http_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::HttpReadSettings - end - def sftp_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::SftpReadSettings - end - def ftp_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::FtpReadSettings - end - def google_cloud_storage_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::GoogleCloudStorageReadSettings - end - def azure_file_storage_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureFileStorageReadSettings - end - def file_server_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::FileServerReadSettings - end - def amazon_s3_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::AmazonS3ReadSettings - end - def azure_data_lake_store_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureDataLakeStoreReadSettings - end - def azure_blob_fsread_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobFSReadSettings - end - def azure_blob_storage_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::AzureBlobStorageReadSettings - end def binary_source Azure::DataFactory::Mgmt::V2018_06_01::Models::BinarySource end def orc_source Azure::DataFactory::Mgmt::V2018_06_01::Models::OrcSource end + def xml_source + Azure::DataFactory::Mgmt::V2018_06_01::Models::XmlSource + end def json_source Azure::DataFactory::Mgmt::V2018_06_01::Models::JsonSource end - def delimited_text_read_settings - Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextReadSettings - end def delimited_text_source Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextSource end def parquet_source Azure::DataFactory::Mgmt::V2018_06_01::Models::ParquetSource end + def excel_source + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExcelSource + end def avro_source Azure::DataFactory::Mgmt::V2018_06_01::Models::AvroSource end @@ -2326,6 +2411,12 @@ module Azure::DataFactory::Profiles::Latest def oracle_sink Azure::DataFactory::Mgmt::V2018_06_01::Models::OracleSink end + def snowflake_import_copy_command + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeImportCopyCommand + end + def snowflake_sink + Azure::DataFactory::Mgmt::V2018_06_01::Models::SnowflakeSink + end def sql_dwsink Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlDWSink end @@ -2410,6 +2501,9 @@ module Azure::DataFactory::Profiles::Latest def delimited_text_sink Azure::DataFactory::Mgmt::V2018_06_01::Models::DelimitedTextSink end + def execution_activity + Azure::DataFactory::Mgmt::V2018_06_01::Models::ExecutionActivity + end def copy_activity Azure::DataFactory::Mgmt::V2018_06_01::Models::CopyActivity end @@ -2488,6 +2582,9 @@ module Azure::DataFactory::Profiles::Latest def ssis_folder Azure::DataFactory::Mgmt::V2018_06_01::Models::SsisFolder end + def global_parameter_type + Azure::DataFactory::Mgmt::V2018_06_01::Models::GlobalParameterType + end def integration_runtime_state Azure::DataFactory::Mgmt::V2018_06_01::Models::IntegrationRuntimeState end @@ -2650,6 +2747,9 @@ module Azure::DataFactory::Profiles::Latest def teradata_partition_option Azure::DataFactory::Mgmt::V2018_06_01::Models::TeradataPartitionOption end + def sql_partition_option + Azure::DataFactory::Mgmt::V2018_06_01::Models::SqlPartitionOption + end def stored_procedure_parameter_type Azure::DataFactory::Mgmt::V2018_06_01::Models::StoredProcedureParameterType end diff --git a/management/azure_mgmt_data_factory/lib/version.rb b/management/azure_mgmt_data_factory/lib/version.rb index 750b2c016..c0c0fde3c 100644 --- a/management/azure_mgmt_data_factory/lib/version.rb +++ b/management/azure_mgmt_data_factory/lib/version.rb @@ -3,5 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. module Azure::DataFactory::Mgmt - VERSION = '0.18.2' + VERSION = '0.18.3' end diff --git a/management/azure_mgmt_event_grid/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index b638c7671..276efa763 100644 --- a/management/azure_mgmt_event_grid/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -138,7 +138,7 @@ module Azure::EventGrid::Mgmt::V2017_06_15_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.1" + sdk_information = "#{sdk_information}/0.20.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 4c6574fc3..610cb7a72 100644 --- a/management/azure_mgmt_event_grid/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -138,7 +138,7 @@ module Azure::EventGrid::Mgmt::V2017_09_15_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.1" + sdk_information = "#{sdk_information}/0.20.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 241496c88..2fd06de5b 100644 --- a/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -138,7 +138,7 @@ module Azure::EventGrid::Mgmt::V2018_01_01 # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.1" + sdk_information = "#{sdk_information}/0.20.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 2463d2637..cb2006bfe 100644 --- a/management/azure_mgmt_event_grid/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -138,7 +138,7 @@ module Azure::EventGrid::Mgmt::V2018_05_01_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.1" + sdk_information = "#{sdk_information}/0.20.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 341813a9b..71a2fd66a 100644 --- a/management/azure_mgmt_event_grid/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -146,7 +146,7 @@ module Azure::EventGrid::Mgmt::V2018_09_15_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.1" + sdk_information = "#{sdk_information}/0.20.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2019-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2019-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb index aa818ea38..440dfc92b 100644 --- a/management/azure_mgmt_event_grid/lib/2019-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2019-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -138,7 +138,7 @@ module Azure::EventGrid::Mgmt::V2019_01_01 # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.1" + sdk_information = "#{sdk_information}/0.20.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 1646e23ce..315b88153 100644 --- a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -146,7 +146,7 @@ module Azure::EventGrid::Mgmt::V2019_02_01_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.1" + sdk_information = "#{sdk_information}/0.20.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2019-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2019-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 2396e3e2b..4d44d02c7 100644 --- a/management/azure_mgmt_event_grid/lib/2019-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2019-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -146,7 +146,7 @@ module Azure::EventGrid::Mgmt::V2019_06_01 # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.1" + sdk_information = "#{sdk_information}/0.20.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2020-01-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2020-01-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 7cfe6ffef..b9746afca 100644 --- a/management/azure_mgmt_event_grid/lib/2020-01-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2020-01-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -146,7 +146,7 @@ module Azure::EventGrid::Mgmt::V2020_01_01_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.1" + sdk_information = "#{sdk_information}/0.20.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 462505aa7..9b54b1ab4 100644 --- a/management/azure_mgmt_event_grid/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -187,7 +187,7 @@ module Azure::EventGrid::Mgmt::V2020_04_01_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.1" + sdk_information = "#{sdk_information}/0.20.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid.rb new file mode 100644 index 000000000..50731f913 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid.rb @@ -0,0 +1,108 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require '2020-06-01/generated/azure_mgmt_event_grid/module_definition' +require 'ms_rest_azure' + +module Azure::EventGrid::Mgmt::V2020_06_01 + autoload :Domains, '2020-06-01/generated/azure_mgmt_event_grid/domains.rb' + autoload :DomainTopics, '2020-06-01/generated/azure_mgmt_event_grid/domain_topics.rb' + autoload :EventSubscriptions, '2020-06-01/generated/azure_mgmt_event_grid/event_subscriptions.rb' + autoload :Operations, '2020-06-01/generated/azure_mgmt_event_grid/operations.rb' + autoload :Topics, '2020-06-01/generated/azure_mgmt_event_grid/topics.rb' + autoload :PrivateEndpointConnections, '2020-06-01/generated/azure_mgmt_event_grid/private_endpoint_connections.rb' + autoload :PrivateLinkResources, '2020-06-01/generated/azure_mgmt_event_grid/private_link_resources.rb' + autoload :TopicTypes, '2020-06-01/generated/azure_mgmt_event_grid/topic_types.rb' + autoload :EventGridManagementClient, '2020-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb' + + module Models + autoload :AdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/advanced_filter.rb' + autoload :EventSubscriptionFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb' + autoload :ConnectionState, '2020-06-01/generated/azure_mgmt_event_grid/models/connection_state.rb' + autoload :RetryPolicy, '2020-06-01/generated/azure_mgmt_event_grid/models/retry_policy.rb' + autoload :InputSchemaMapping, '2020-06-01/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb' + autoload :DeadLetterDestination, '2020-06-01/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb' + autoload :Resource, '2020-06-01/generated/azure_mgmt_event_grid/models/resource.rb' + autoload :EventSubscriptionsListResult, '2020-06-01/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb' + autoload :JsonFieldWithDefault, '2020-06-01/generated/azure_mgmt_event_grid/models/json_field_with_default.rb' + autoload :EventSubscriptionFullUrl, '2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb' + autoload :JsonField, '2020-06-01/generated/azure_mgmt_event_grid/models/json_field.rb' + autoload :TopicSharedAccessKeys, '2020-06-01/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb' + autoload :DomainUpdateParameters, '2020-06-01/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb' + autoload :TopicsListResult, '2020-06-01/generated/azure_mgmt_event_grid/models/topics_list_result.rb' + autoload :DomainSharedAccessKeys, '2020-06-01/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb' + autoload :EventSubscriptionUpdateParameters, '2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb' + autoload :TopicUpdateParameters, '2020-06-01/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb' + autoload :OperationInfo, '2020-06-01/generated/azure_mgmt_event_grid/models/operation_info.rb' + autoload :EventSubscriptionDestination, '2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb' + autoload :Operation, '2020-06-01/generated/azure_mgmt_event_grid/models/operation.rb' + autoload :TopicRegenerateKeyRequest, '2020-06-01/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb' + autoload :InboundIpRule, '2020-06-01/generated/azure_mgmt_event_grid/models/inbound_ip_rule.rb' + autoload :OperationsListResult, '2020-06-01/generated/azure_mgmt_event_grid/models/operations_list_result.rb' + autoload :DomainsListResult, '2020-06-01/generated/azure_mgmt_event_grid/models/domains_list_result.rb' + autoload :PrivateEndpointConnectionListResult, '2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection_list_result.rb' + autoload :DomainTopicsListResult, '2020-06-01/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb' + autoload :PrivateLinkResource, '2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resource.rb' + autoload :PrivateLinkResourcesListResult, '2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resources_list_result.rb' + autoload :PrivateEndpoint, '2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint.rb' + autoload :TopicTypesListResult, '2020-06-01/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb' + autoload :DomainRegenerateKeyRequest, '2020-06-01/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb' + autoload :EventTypesListResult, '2020-06-01/generated/azure_mgmt_event_grid/models/event_types_list_result.rb' + autoload :PrivateEndpointConnection, '2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection.rb' + autoload :JsonInputSchemaMapping, '2020-06-01/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb' + autoload :TrackedResource, '2020-06-01/generated/azure_mgmt_event_grid/models/tracked_resource.rb' + autoload :Domain, '2020-06-01/generated/azure_mgmt_event_grid/models/domain.rb' + autoload :DomainTopic, '2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic.rb' + autoload :NumberInAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb' + autoload :StorageBlobDeadLetterDestination, '2020-06-01/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb' + autoload :NumberNotInAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb' + autoload :NumberLessThanAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb' + autoload :NumberGreaterThanAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb' + autoload :NumberLessThanOrEqualsAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb' + autoload :NumberGreaterThanOrEqualsAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb' + autoload :BoolEqualsAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb' + autoload :StringInAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb' + autoload :StringNotInAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb' + autoload :StringBeginsWithAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb' + autoload :StringEndsWithAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb' + autoload :StringContainsAdvancedFilter, '2020-06-01/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb' + autoload :WebHookEventSubscriptionDestination, '2020-06-01/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb' + autoload :EventHubEventSubscriptionDestination, '2020-06-01/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb' + autoload :StorageQueueEventSubscriptionDestination, '2020-06-01/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb' + autoload :HybridConnectionEventSubscriptionDestination, '2020-06-01/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb' + autoload :ServiceBusQueueEventSubscriptionDestination, '2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb' + autoload :ServiceBusTopicEventSubscriptionDestination, '2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb' + autoload :AzureFunctionEventSubscriptionDestination, '2020-06-01/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.rb' + autoload :EventSubscription, '2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription.rb' + autoload :Topic, '2020-06-01/generated/azure_mgmt_event_grid/models/topic.rb' + autoload :EventType, '2020-06-01/generated/azure_mgmt_event_grid/models/event_type.rb' + autoload :TopicTypeInfo, '2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_info.rb' + autoload :PersistedConnectionStatus, '2020-06-01/generated/azure_mgmt_event_grid/models/persisted_connection_status.rb' + autoload :ResourceProvisioningState, '2020-06-01/generated/azure_mgmt_event_grid/models/resource_provisioning_state.rb' + autoload :DomainProvisioningState, '2020-06-01/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb' + autoload :InputSchema, '2020-06-01/generated/azure_mgmt_event_grid/models/input_schema.rb' + autoload :PublicNetworkAccess, '2020-06-01/generated/azure_mgmt_event_grid/models/public_network_access.rb' + autoload :IpActionType, '2020-06-01/generated/azure_mgmt_event_grid/models/ip_action_type.rb' + autoload :DomainTopicProvisioningState, '2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb' + autoload :EventSubscriptionProvisioningState, '2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb' + autoload :EventDeliverySchema, '2020-06-01/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb' + autoload :TopicProvisioningState, '2020-06-01/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb' + autoload :ResourceRegionType, '2020-06-01/generated/azure_mgmt_event_grid/models/resource_region_type.rb' + autoload :TopicTypeProvisioningState, '2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb' + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/domain_topics.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/domain_topics.rb new file mode 100644 index 000000000..8261b7c81 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/domain_topics.rb @@ -0,0 +1,699 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + # + # Azure EventGrid Management Client + # + class DomainTopics + include MsRestAzure + + # + # Creates and initializes a new instance of the DomainTopics class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # Get a domain topic. + # + # Get properties of a domain topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainTopic] operation results. + # + def get(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + response = get_async(resource_group_name, domain_name, domain_topic_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a domain topic. + # + # Get properties of a domain topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + get_async(resource_group_name, domain_name, domain_topic_name, custom_headers:custom_headers).value! + end + + # + # Get a domain topic. + # + # Get properties of a domain topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the topic. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'domain_topic_name is nil' if domain_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name,'domainTopicName' => domain_topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopic.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update a domain topic. + # + # Asynchronously creates or updates a new domain topic with the specified + # parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the domain topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainTopic] operation results. + # + def create_or_update(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + response = create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the domain topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopic.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Delete a domain topic. + # + # Delete existing domain topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the domain topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + response = delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the domain topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Domain name. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_domain(resource_group_name, domain_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_domain_as_lazy(resource_group_name, domain_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Domain name. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_domain_with_http_info(resource_group_name, domain_name, filter:nil, top:nil, custom_headers:nil) + list_by_domain_async(resource_group_name, domain_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Domain name. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_domain_async(resource_group_name, domain_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update a domain topic. + # + # Asynchronously creates or updates a new domain topic with the specified + # parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the domain topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainTopic] operation results. + # + def begin_create_or_update(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update a domain topic. + # + # Asynchronously creates or updates a new domain topic with the specified + # parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the domain topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + begin_create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers:custom_headers).value! + end + + # + # Create or update a domain topic. + # + # Asynchronously creates or updates a new domain topic with the specified + # parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the domain topic. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'domain_topic_name is nil' if domain_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name,'domainTopicName' => domain_topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopic.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete a domain topic. + # + # Delete existing domain topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the domain topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete a domain topic. + # + # Delete existing domain topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the domain topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + begin_delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers:custom_headers).value! + end + + # + # Delete a domain topic. + # + # Delete existing domain topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_topic_name [String] Name of the domain topic. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'domain_topic_name is nil' if domain_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name,'domainTopicName' => domain_topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainTopicsListResult] operation results. + # + def list_by_domain_next(next_page_link, custom_headers:nil) + response = list_by_domain_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_domain_next_with_http_info(next_page_link, custom_headers:nil) + list_by_domain_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_domain_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Domain name. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainTopicsListResult] which provide lazy access to pages of the + # response. + # + def list_by_domain_as_lazy(resource_group_name, domain_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_domain_async(resource_group_name, domain_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_domain_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/domains.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/domains.rb new file mode 100644 index 000000000..710ac10a6 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/domains.rb @@ -0,0 +1,1328 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + # + # Azure EventGrid Management Client + # + class Domains + include MsRestAzure + + # + # Creates and initializes a new instance of the Domains class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # Get a domain. + # + # Get properties of a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Domain] operation results. + # + def get(resource_group_name, domain_name, custom_headers:nil) + response = get_async(resource_group_name, domain_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a domain. + # + # Get properties of a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, domain_name, custom_headers:nil) + get_async(resource_group_name, domain_name, custom_headers:custom_headers).value! + end + + # + # Get a domain. + # + # Get properties of a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, domain_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update a domain. + # + # Asynchronously creates or updates a new domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_info [Domain] Domain information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Domain] operation results. + # + def create_or_update(resource_group_name, domain_name, domain_info, custom_headers:nil) + response = create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_info [Domain] Domain information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Delete a domain. + # + # Delete existing domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, domain_name, custom_headers:nil) + response = delete_async(resource_group_name, domain_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, domain_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, domain_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Update a domain. + # + # Asynchronously updates a domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_update_parameters [DomainUpdateParameters] Domain update + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Domain] operation results. + # + def update(resource_group_name, domain_name, domain_update_parameters, custom_headers:nil) + response = update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_update_parameters [DomainUpdateParameters] Domain update + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers:nil) + # Send request + promise = begin_update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # List domains under an Azure subscription. + # + # List all the domains under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_subscription(filter:nil, top:nil, custom_headers:nil) + first_page = list_by_subscription_as_lazy(filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List domains under an Azure subscription. + # + # List all the domains under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_with_http_info(filter:nil, top:nil, custom_headers:nil) + list_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List domains under an Azure subscription. + # + # List all the domains under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_async(filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/domains' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List domains under a resource group. + # + # List all the domains under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource_group(resource_group_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List domains under a resource group. + # + # List all the domains under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, custom_headers:nil) + list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List domains under a resource group. + # + # List all the domains under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List keys for a domain. + # + # List the two keys used to publish to a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainSharedAccessKeys] operation results. + # + def list_shared_access_keys(resource_group_name, domain_name, custom_headers:nil) + response = list_shared_access_keys_async(resource_group_name, domain_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List keys for a domain. + # + # List the two keys used to publish to a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_shared_access_keys_with_http_info(resource_group_name, domain_name, custom_headers:nil) + list_shared_access_keys_async(resource_group_name, domain_name, custom_headers:custom_headers).value! + end + + # + # List keys for a domain. + # + # List the two keys used to publish to a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_shared_access_keys_async(resource_group_name, domain_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/listKeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainSharedAccessKeys.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Regenerate key for a domain. + # + # Regenerate a shared access key for a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param regenerate_key_request [DomainRegenerateKeyRequest] Request body to + # regenerate key. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainSharedAccessKeys] operation results. + # + def regenerate_key(resource_group_name, domain_name, regenerate_key_request, custom_headers:nil) + response = regenerate_key_async(resource_group_name, domain_name, regenerate_key_request, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Regenerate key for a domain. + # + # Regenerate a shared access key for a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param regenerate_key_request [DomainRegenerateKeyRequest] Request body to + # regenerate key. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def regenerate_key_with_http_info(resource_group_name, domain_name, regenerate_key_request, custom_headers:nil) + regenerate_key_async(resource_group_name, domain_name, regenerate_key_request, custom_headers:custom_headers).value! + end + + # + # Regenerate key for a domain. + # + # Regenerate a shared access key for a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param regenerate_key_request [DomainRegenerateKeyRequest] Request body to + # regenerate key. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def regenerate_key_async(resource_group_name, domain_name, regenerate_key_request, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'regenerate_key_request is nil' if regenerate_key_request.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainRegenerateKeyRequest.mapper() + request_content = @client.serialize(request_mapper, regenerate_key_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainSharedAccessKeys.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update a domain. + # + # Asynchronously creates or updates a new domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_info [Domain] Domain information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Domain] operation results. + # + def begin_create_or_update(resource_group_name, domain_name, domain_info, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update a domain. + # + # Asynchronously creates or updates a new domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_info [Domain] Domain information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, domain_name, domain_info, custom_headers:nil) + begin_create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers:custom_headers).value! + end + + # + # Create or update a domain. + # + # Asynchronously creates or updates a new domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_info [Domain] Domain information. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'domain_info is nil' if domain_info.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain.mapper() + request_content = @client.serialize(request_mapper, domain_info) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete a domain. + # + # Delete existing domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, domain_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, domain_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete a domain. + # + # Delete existing domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, domain_name, custom_headers:nil) + begin_delete_async(resource_group_name, domain_name, custom_headers:custom_headers).value! + end + + # + # Delete a domain. + # + # Delete existing domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, domain_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update a domain. + # + # Asynchronously updates a domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_update_parameters [DomainUpdateParameters] Domain update + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Domain] operation results. + # + def begin_update(resource_group_name, domain_name, domain_update_parameters, custom_headers:nil) + response = begin_update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update a domain. + # + # Asynchronously updates a domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_update_parameters [DomainUpdateParameters] Domain update + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, domain_name, domain_update_parameters, custom_headers:nil) + begin_update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers:custom_headers).value! + end + + # + # Update a domain. + # + # Asynchronously updates a domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain. + # @param domain_update_parameters [DomainUpdateParameters] Domain update + # information. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'domain_update_parameters is nil' if domain_update_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, domain_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List domains under an Azure subscription. + # + # List all the domains under an Azure subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainsListResult] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers:nil) + response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List domains under an Azure subscription. + # + # List all the domains under an Azure subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil) + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List domains under an Azure subscription. + # + # List all the domains under an Azure subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List domains under a resource group. + # + # List all the domains under a resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainsListResult] operation results. + # + def list_by_resource_group_next(next_page_link, custom_headers:nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List domains under a resource group. + # + # List all the domains under a resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil) + list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List domains under a resource group. + # + # List all the domains under a resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List domains under an Azure subscription. + # + # List all the domains under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainsListResult] which provide lazy access to pages of the + # response. + # + def list_by_subscription_as_lazy(filter:nil, top:nil, custom_headers:nil) + response = list_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List domains under a resource group. + # + # List all the domains under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainsListResult] which provide lazy access to pages of the + # response. + # + def list_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb new file mode 100644 index 000000000..69959eec5 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -0,0 +1,161 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + # + # A service client - single point of access to the REST API. + # + class EventGridManagementClient < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] Subscription credentials that uniquely identify a + # Microsoft Azure subscription. The subscription ID forms part of the URI + # for every service call. + attr_accessor :subscription_id + + # @return [String] Version of the API to be used with the client request. + attr_reader :api_version + + # @return [String] The preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] The retry timeout in seconds for Long Running + # Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] Whether a unique x-ms-client-request-id should be + # generated. When set to true a unique x-ms-client-request-id value is + # generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [Domains] domains + attr_reader :domains + + # @return [DomainTopics] domain_topics + attr_reader :domain_topics + + # @return [EventSubscriptions] event_subscriptions + attr_reader :event_subscriptions + + # @return [Operations] operations + attr_reader :operations + + # @return [Topics] topics + attr_reader :topics + + # @return [PrivateEndpointConnections] private_endpoint_connections + attr_reader :private_endpoint_connections + + # @return [PrivateLinkResources] private_link_resources + attr_reader :private_link_resources + + # @return [TopicTypes] topic_types + attr_reader :topic_types + + # + # Creates initializes a new instance of the EventGridManagementClient class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @domains = Domains.new(self) + @domain_topics = DomainTopics.new(self) + @event_subscriptions = EventSubscriptions.new(self) + @operations = Operations.new(self) + @topics = Topics.new(self) + @private_endpoint_connections = PrivateEndpointConnections.new(self) + @private_link_resources = PrivateLinkResources.new(self) + @topic_types = TopicTypes.new(self) + @api_version = '2020-06-01' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) + @request_headers['Content-Type'] = options[:headers]['Content-Type'] + end + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_event_grid' + sdk_information = "#{sdk_information}/0.20.2" + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_subscriptions.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_subscriptions.rb new file mode 100644 index 000000000..ec7ab3ffe --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_subscriptions.rb @@ -0,0 +1,3648 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + # + # Azure EventGrid Management Client + # + class EventSubscriptions + include MsRestAzure + + # + # Creates and initializes a new instance of the EventSubscriptions class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # Get an event subscription. + # + # Get properties of an event subscription. + # + # @param scope [String] The scope of the event subscription. The scope can be a + # subscription, or a resource group, or a top level resource belonging to a + # resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscription] operation results. + # + def get(scope, event_subscription_name, custom_headers:nil) + response = get_async(scope, event_subscription_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get an event subscription. + # + # Get properties of an event subscription. + # + # @param scope [String] The scope of the event subscription. The scope can be a + # subscription, or a resource group, or a top level resource belonging to a + # resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(scope, event_subscription_name, custom_headers:nil) + get_async(scope, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Get an event subscription. + # + # Get properties of an event subscription. + # + # @param scope [String] The scope of the event subscription. The scope can be a + # subscription, or a resource group, or a top level resource belonging to a + # resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(scope, event_subscription_name, custom_headers:nil) + fail ArgumentError, 'scope is nil' if scope.nil? + fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'eventSubscriptionName' => event_subscription_name}, + skip_encoding_path_params: {'scope' => scope}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an event subscription. + # + # Asynchronously creates a new event subscription or updates an existing event + # subscription based on the specified scope. + # + # @param scope [String] The identifier of the resource to which the event + # subscription needs to be created or updated. The scope can be a subscription, + # or a resource group, or a top level resource belonging to a resource provider + # namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. Event + # subscription names must be between 3 and 64 characters in length and should + # use alphanumeric letters only. + # @param event_subscription_info [EventSubscription] Event subscription + # properties containing the destination and filter information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscription] operation results. + # + def create_or_update(scope, event_subscription_name, event_subscription_info, custom_headers:nil) + response = create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param scope [String] The identifier of the resource to which the event + # subscription needs to be created or updated. The scope can be a subscription, + # or a resource group, or a top level resource belonging to a resource provider + # namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. Event + # subscription names must be between 3 and 64 characters in length and should + # use alphanumeric letters only. + # @param event_subscription_info [EventSubscription] Event subscription + # properties containing the destination and filter information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Delete an event subscription. + # + # Delete an existing event subscription. + # + # @param scope [String] The scope of the event subscription. The scope can be a + # subscription, or a resource group, or a top level resource belonging to a + # resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(scope, event_subscription_name, custom_headers:nil) + response = delete_async(scope, event_subscription_name, custom_headers:custom_headers).value! + nil + end + + # + # @param scope [String] The scope of the event subscription. The scope can be a + # subscription, or a resource group, or a top level resource belonging to a + # resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(scope, event_subscription_name, custom_headers:nil) + # Send request + promise = begin_delete_async(scope, event_subscription_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Update an event subscription. + # + # Asynchronously updates an existing event subscription. + # + # @param scope [String] The scope of existing event subscription. The scope can + # be a subscription, or a resource group, or a top level resource belonging to + # a resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription to be + # updated. + # @param event_subscription_update_parameters + # [EventSubscriptionUpdateParameters] Updated event subscription information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscription] operation results. + # + def update(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + response = update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param scope [String] The scope of existing event subscription. The scope can + # be a subscription, or a resource group, or a top level resource belonging to + # a resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription to be + # updated. + # @param event_subscription_update_parameters + # [EventSubscriptionUpdateParameters] Updated event subscription information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + # Send request + promise = begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Get full URL of an event subscription. + # + # Get the full endpoint URL for an event subscription. + # + # @param scope [String] The scope of the event subscription. The scope can be a + # subscription, or a resource group, or a top level resource belonging to a + # resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionFullUrl] operation results. + # + def get_full_url(scope, event_subscription_name, custom_headers:nil) + response = get_full_url_async(scope, event_subscription_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get full URL of an event subscription. + # + # Get the full endpoint URL for an event subscription. + # + # @param scope [String] The scope of the event subscription. The scope can be a + # subscription, or a resource group, or a top level resource belonging to a + # resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_full_url_with_http_info(scope, event_subscription_name, custom_headers:nil) + get_full_url_async(scope, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Get full URL of an event subscription. + # + # Get the full endpoint URL for an event subscription. + # + # @param scope [String] The scope of the event subscription. The scope can be a + # subscription, or a resource group, or a top level resource belonging to a + # resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_full_url_async(scope, event_subscription_name, custom_headers:nil) + fail ArgumentError, 'scope is nil' if scope.nil? + fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'eventSubscriptionName' => event_subscription_name}, + skip_encoding_path_params: {'scope' => scope}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFullUrl.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get an aggregated list of all global event subscriptions under an Azure + # subscription. + # + # List all aggregated global event subscriptions under a specific Azure + # subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_global_by_subscription(filter:nil, top:nil, custom_headers:nil) + first_page = list_global_by_subscription_as_lazy(filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Get an aggregated list of all global event subscriptions under an Azure + # subscription. + # + # List all aggregated global event subscriptions under a specific Azure + # subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_subscription_with_http_info(filter:nil, top:nil, custom_headers:nil) + list_global_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # Get an aggregated list of all global event subscriptions under an Azure + # subscription. + # + # List all aggregated global event subscriptions under a specific Azure + # subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_subscription_async(filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all global event subscriptions for a topic type. + # + # List all global event subscriptions under an Azure subscription for a topic + # type. + # + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_global_by_subscription_for_topic_type(topic_type_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_global_by_subscription_for_topic_type_as_lazy(topic_type_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List all global event subscriptions for a topic type. + # + # List all global event subscriptions under an Azure subscription for a topic + # type. + # + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_subscription_for_topic_type_with_http_info(topic_type_name, filter:nil, top:nil, custom_headers:nil) + list_global_by_subscription_for_topic_type_async(topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List all global event subscriptions for a topic type. + # + # List all global event subscriptions under an Azure subscription for a topic + # type. + # + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_subscription_for_topic_type_async(topic_type_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all global event subscriptions under an Azure subscription and resource + # group. + # + # List all global event subscriptions under a specific Azure subscription and + # resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_global_by_resource_group(resource_group_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_global_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List all global event subscriptions under an Azure subscription and resource + # group. + # + # List all global event subscriptions under a specific Azure subscription and + # resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, custom_headers:nil) + list_global_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List all global event subscriptions under an Azure subscription and resource + # group. + # + # List all global event subscriptions under a specific Azure subscription and + # resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_resource_group_async(resource_group_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all global event subscriptions under a resource group for a topic type. + # + # List all global event subscriptions under a resource group for a specific + # topic type. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_global_by_resource_group_for_topic_type(resource_group_name, topic_type_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_global_by_resource_group_for_topic_type_as_lazy(resource_group_name, topic_type_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List all global event subscriptions under a resource group for a topic type. + # + # List all global event subscriptions under a resource group for a specific + # topic type. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_resource_group_for_topic_type_with_http_info(resource_group_name, topic_type_name, filter:nil, top:nil, custom_headers:nil) + list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List all global event subscriptions under a resource group for a topic type. + # + # List all global event subscriptions under a resource group for a specific + # topic type. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all regional event subscriptions under an Azure subscription. + # + # List all event subscriptions from the given location under a specific Azure + # subscription. + # + # @param location [String] Name of the location. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_regional_by_subscription(location, filter:nil, top:nil, custom_headers:nil) + first_page = list_regional_by_subscription_as_lazy(location, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List all regional event subscriptions under an Azure subscription. + # + # List all event subscriptions from the given location under a specific Azure + # subscription. + # + # @param location [String] Name of the location. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_subscription_with_http_info(location, filter:nil, top:nil, custom_headers:nil) + list_regional_by_subscription_async(location, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List all regional event subscriptions under an Azure subscription. + # + # List all event subscriptions from the given location under a specific Azure + # subscription. + # + # @param location [String] Name of the location. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_subscription_async(location, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'location is nil' if location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'location' => location}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_regional_by_resource_group(resource_group_name, location, filter:nil, top:nil, custom_headers:nil) + first_page = list_regional_by_resource_group_as_lazy(resource_group_name, location, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_resource_group_with_http_info(resource_group_name, location, filter:nil, top:nil, custom_headers:nil) + list_regional_by_resource_group_async(resource_group_name, location, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_resource_group_async(resource_group_name, location, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'location is nil' if location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'location' => location}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all regional event subscriptions under an Azure subscription for a topic + # type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and topic type. + # + # @param location [String] Name of the location. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_regional_by_subscription_for_topic_type(location, topic_type_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_regional_by_subscription_for_topic_type_as_lazy(location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List all regional event subscriptions under an Azure subscription for a topic + # type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and topic type. + # + # @param location [String] Name of the location. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_subscription_for_topic_type_with_http_info(location, topic_type_name, filter:nil, top:nil, custom_headers:nil) + list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List all regional event subscriptions under an Azure subscription for a topic + # type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and topic type. + # + # @param location [String] Name of the location. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'location is nil' if location.nil? + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'location' => location,'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group for a topic type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group and topic type. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_regional_by_resource_group_for_topic_type(resource_group_name, location, topic_type_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_regional_by_resource_group_for_topic_type_as_lazy(resource_group_name, location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group for a topic type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group and topic type. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_resource_group_for_topic_type_with_http_info(resource_group_name, location, topic_type_name, filter:nil, top:nil, custom_headers:nil) + list_regional_by_resource_group_for_topic_type_async(resource_group_name, location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group for a topic type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group and topic type. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_resource_group_for_topic_type_async(resource_group_name, location, topic_type_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'location is nil' if location.nil? + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'location' => location,'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all event subscriptions for a specific topic. + # + # List all event subscriptions that have been created for a specific topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic. + # @param resource_type_name [String] Name of the resource type. + # @param resource_name [String] Name of the resource. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_resource_as_lazy(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List all event subscriptions for a specific topic. + # + # List all event subscriptions that have been created for a specific topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic. + # @param resource_type_name [String] Name of the resource type. + # @param resource_name [String] Name of the resource. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_with_http_info(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:nil, top:nil, custom_headers:nil) + list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List all event subscriptions for a specific topic. + # + # List all event subscriptions that have been created for a specific topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic. + # @param resource_type_name [String] Name of the resource type. + # @param resource_name [String] Name of the resource. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'provider_namespace is nil' if provider_namespace.nil? + fail ArgumentError, 'resource_type_name is nil' if resource_type_name.nil? + fail ArgumentError, 'resource_name is nil' if resource_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerNamespace' => provider_namespace,'resourceTypeName' => resource_type_name,'resourceName' => resource_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all event subscriptions for a specific domain topic. + # + # List all event subscriptions that have been created for a specific domain + # topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the top level domain. + # @param topic_name [String] Name of the domain topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_domain_topic(resource_group_name, domain_name, topic_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_domain_topic_as_lazy(resource_group_name, domain_name, topic_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List all event subscriptions for a specific domain topic. + # + # List all event subscriptions that have been created for a specific domain + # topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the top level domain. + # @param topic_name [String] Name of the domain topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_domain_topic_with_http_info(resource_group_name, domain_name, topic_name, filter:nil, top:nil, custom_headers:nil) + list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List all event subscriptions for a specific domain topic. + # + # List all event subscriptions that have been created for a specific domain + # topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the top level domain. + # @param topic_name [String] Name of the domain topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/providers/Microsoft.EventGrid/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update an event subscription. + # + # Asynchronously creates a new event subscription or updates an existing event + # subscription based on the specified scope. + # + # @param scope [String] The identifier of the resource to which the event + # subscription needs to be created or updated. The scope can be a subscription, + # or a resource group, or a top level resource belonging to a resource provider + # namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. Event + # subscription names must be between 3 and 64 characters in length and should + # use alphanumeric letters only. + # @param event_subscription_info [EventSubscription] Event subscription + # properties containing the destination and filter information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscription] operation results. + # + def begin_create_or_update(scope, event_subscription_name, event_subscription_info, custom_headers:nil) + response = begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an event subscription. + # + # Asynchronously creates a new event subscription or updates an existing event + # subscription based on the specified scope. + # + # @param scope [String] The identifier of the resource to which the event + # subscription needs to be created or updated. The scope can be a subscription, + # or a resource group, or a top level resource belonging to a resource provider + # namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. Event + # subscription names must be between 3 and 64 characters in length and should + # use alphanumeric letters only. + # @param event_subscription_info [EventSubscription] Event subscription + # properties containing the destination and filter information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(scope, event_subscription_name, event_subscription_info, custom_headers:nil) + begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value! + end + + # + # Create or update an event subscription. + # + # Asynchronously creates a new event subscription or updates an existing event + # subscription based on the specified scope. + # + # @param scope [String] The identifier of the resource to which the event + # subscription needs to be created or updated. The scope can be a subscription, + # or a resource group, or a top level resource belonging to a resource provider + # namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. Event + # subscription names must be between 3 and 64 characters in length and should + # use alphanumeric letters only. + # @param event_subscription_info [EventSubscription] Event subscription + # properties containing the destination and filter information. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:nil) + fail ArgumentError, 'scope is nil' if scope.nil? + fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil? + fail ArgumentError, 'event_subscription_info is nil' if event_subscription_info.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription.mapper() + request_content = @client.serialize(request_mapper, event_subscription_info) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'eventSubscriptionName' => event_subscription_name}, + skip_encoding_path_params: {'scope' => scope}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete an event subscription. + # + # Delete an existing event subscription. + # + # @param scope [String] The scope of the event subscription. The scope can be a + # subscription, or a resource group, or a top level resource belonging to a + # resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(scope, event_subscription_name, custom_headers:nil) + response = begin_delete_async(scope, event_subscription_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete an event subscription. + # + # Delete an existing event subscription. + # + # @param scope [String] The scope of the event subscription. The scope can be a + # subscription, or a resource group, or a top level resource belonging to a + # resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(scope, event_subscription_name, custom_headers:nil) + begin_delete_async(scope, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Delete an event subscription. + # + # Delete an existing event subscription. + # + # @param scope [String] The scope of the event subscription. The scope can be a + # subscription, or a resource group, or a top level resource belonging to a + # resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(scope, event_subscription_name, custom_headers:nil) + fail ArgumentError, 'scope is nil' if scope.nil? + fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'eventSubscriptionName' => event_subscription_name}, + skip_encoding_path_params: {'scope' => scope}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update an event subscription. + # + # Asynchronously updates an existing event subscription. + # + # @param scope [String] The scope of existing event subscription. The scope can + # be a subscription, or a resource group, or a top level resource belonging to + # a resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription to be + # updated. + # @param event_subscription_update_parameters + # [EventSubscriptionUpdateParameters] Updated event subscription information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscription] operation results. + # + def begin_update(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + response = begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update an event subscription. + # + # Asynchronously updates an existing event subscription. + # + # @param scope [String] The scope of existing event subscription. The scope can + # be a subscription, or a resource group, or a top level resource belonging to + # a resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription to be + # updated. + # @param event_subscription_update_parameters + # [EventSubscriptionUpdateParameters] Updated event subscription information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value! + end + + # + # Update an event subscription. + # + # Asynchronously updates an existing event subscription. + # + # @param scope [String] The scope of existing event subscription. The scope can + # be a subscription, or a resource group, or a top level resource belonging to + # a resource provider namespace, or an EventGrid topic. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for a resource, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + # for an EventGrid topic. + # @param event_subscription_name [String] Name of the event subscription to be + # updated. + # @param event_subscription_update_parameters + # [EventSubscriptionUpdateParameters] Updated event subscription information. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + fail ArgumentError, 'scope is nil' if scope.nil? + fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil? + fail ArgumentError, 'event_subscription_update_parameters is nil' if event_subscription_update_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, event_subscription_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'eventSubscriptionName' => event_subscription_name}, + skip_encoding_path_params: {'scope' => scope}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get an aggregated list of all global event subscriptions under an Azure + # subscription. + # + # List all aggregated global event subscriptions under a specific Azure + # subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_global_by_subscription_next(next_page_link, custom_headers:nil) + response = list_global_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get an aggregated list of all global event subscriptions under an Azure + # subscription. + # + # List all aggregated global event subscriptions under a specific Azure + # subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_subscription_next_with_http_info(next_page_link, custom_headers:nil) + list_global_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Get an aggregated list of all global event subscriptions under an Azure + # subscription. + # + # List all aggregated global event subscriptions under a specific Azure + # subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_subscription_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all global event subscriptions for a topic type. + # + # List all global event subscriptions under an Azure subscription for a topic + # type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_global_by_subscription_for_topic_type_next(next_page_link, custom_headers:nil) + response = list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List all global event subscriptions for a topic type. + # + # List all global event subscriptions under an Azure subscription for a topic + # type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_subscription_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil) + list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List all global event subscriptions for a topic type. + # + # List all global event subscriptions under an Azure subscription for a topic + # type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all global event subscriptions under an Azure subscription and resource + # group. + # + # List all global event subscriptions under a specific Azure subscription and + # resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_global_by_resource_group_next(next_page_link, custom_headers:nil) + response = list_global_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List all global event subscriptions under an Azure subscription and resource + # group. + # + # List all global event subscriptions under a specific Azure subscription and + # resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil) + list_global_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List all global event subscriptions under an Azure subscription and resource + # group. + # + # List all global event subscriptions under a specific Azure subscription and + # resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_resource_group_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all global event subscriptions under a resource group for a topic type. + # + # List all global event subscriptions under a resource group for a specific + # topic type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_global_by_resource_group_for_topic_type_next(next_page_link, custom_headers:nil) + response = list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List all global event subscriptions under a resource group for a topic type. + # + # List all global event subscriptions under a resource group for a specific + # topic type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_resource_group_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil) + list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List all global event subscriptions under a resource group for a topic type. + # + # List all global event subscriptions under a resource group for a specific + # topic type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all regional event subscriptions under an Azure subscription. + # + # List all event subscriptions from the given location under a specific Azure + # subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_regional_by_subscription_next(next_page_link, custom_headers:nil) + response = list_regional_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List all regional event subscriptions under an Azure subscription. + # + # List all event subscriptions from the given location under a specific Azure + # subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_subscription_next_with_http_info(next_page_link, custom_headers:nil) + list_regional_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List all regional event subscriptions under an Azure subscription. + # + # List all event subscriptions from the given location under a specific Azure + # subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_subscription_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_regional_by_resource_group_next(next_page_link, custom_headers:nil) + response = list_regional_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil) + list_regional_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_resource_group_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all regional event subscriptions under an Azure subscription for a topic + # type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and topic type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_regional_by_subscription_for_topic_type_next(next_page_link, custom_headers:nil) + response = list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List all regional event subscriptions under an Azure subscription for a topic + # type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and topic type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_subscription_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil) + list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List all regional event subscriptions under an Azure subscription for a topic + # type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and topic type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group for a topic type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group and topic type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_regional_by_resource_group_for_topic_type_next(next_page_link, custom_headers:nil) + response = list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group for a topic type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group and topic type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_resource_group_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil) + list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group for a topic type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group and topic type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all event subscriptions for a specific topic. + # + # List all event subscriptions that have been created for a specific topic. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_by_resource_next(next_page_link, custom_headers:nil) + response = list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List all event subscriptions for a specific topic. + # + # List all event subscriptions that have been created for a specific topic. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_next_with_http_info(next_page_link, custom_headers:nil) + list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List all event subscriptions for a specific topic. + # + # List all event subscriptions that have been created for a specific topic. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all event subscriptions for a specific domain topic. + # + # List all event subscriptions that have been created for a specific domain + # topic. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_by_domain_topic_next(next_page_link, custom_headers:nil) + response = list_by_domain_topic_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List all event subscriptions for a specific domain topic. + # + # List all event subscriptions that have been created for a specific domain + # topic. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_domain_topic_next_with_http_info(next_page_link, custom_headers:nil) + list_by_domain_topic_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List all event subscriptions for a specific domain topic. + # + # List all event subscriptions that have been created for a specific domain + # topic. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_domain_topic_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get an aggregated list of all global event subscriptions under an Azure + # subscription. + # + # List all aggregated global event subscriptions under a specific Azure + # subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_global_by_subscription_as_lazy(filter:nil, top:nil, custom_headers:nil) + response = list_global_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_global_by_subscription_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List all global event subscriptions for a topic type. + # + # List all global event subscriptions under an Azure subscription for a topic + # type. + # + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_global_by_subscription_for_topic_type_as_lazy(topic_type_name, filter:nil, top:nil, custom_headers:nil) + response = list_global_by_subscription_for_topic_type_async(topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List all global event subscriptions under an Azure subscription and resource + # group. + # + # List all global event subscriptions under a specific Azure subscription and + # resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_global_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, custom_headers:nil) + response = list_global_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_global_by_resource_group_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List all global event subscriptions under a resource group for a topic type. + # + # List all global event subscriptions under a resource group for a specific + # topic type. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_global_by_resource_group_for_topic_type_as_lazy(resource_group_name, topic_type_name, filter:nil, top:nil, custom_headers:nil) + response = list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List all regional event subscriptions under an Azure subscription. + # + # List all event subscriptions from the given location under a specific Azure + # subscription. + # + # @param location [String] Name of the location. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_regional_by_subscription_as_lazy(location, filter:nil, top:nil, custom_headers:nil) + response = list_regional_by_subscription_async(location, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_regional_by_subscription_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_regional_by_resource_group_as_lazy(resource_group_name, location, filter:nil, top:nil, custom_headers:nil) + response = list_regional_by_resource_group_async(resource_group_name, location, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_regional_by_resource_group_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List all regional event subscriptions under an Azure subscription for a topic + # type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and topic type. + # + # @param location [String] Name of the location. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_regional_by_subscription_for_topic_type_as_lazy(location, topic_type_name, filter:nil, top:nil, custom_headers:nil) + response = list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List all regional event subscriptions under an Azure subscription and + # resource group for a topic type. + # + # List all event subscriptions from the given location under a specific Azure + # subscription and resource group and topic type. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location. + # @param topic_type_name [String] Name of the topic type. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_regional_by_resource_group_for_topic_type_as_lazy(resource_group_name, location, topic_type_name, filter:nil, top:nil, custom_headers:nil) + response = list_regional_by_resource_group_for_topic_type_async(resource_group_name, location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List all event subscriptions for a specific topic. + # + # List all event subscriptions that have been created for a specific topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic. + # @param resource_type_name [String] Name of the resource type. + # @param resource_name [String] Name of the resource. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_by_resource_as_lazy(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List all event subscriptions for a specific domain topic. + # + # List all event subscriptions that have been created for a specific domain + # topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the top level domain. + # @param topic_name [String] Name of the domain topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_by_domain_topic_as_lazy(resource_group_name, domain_name, topic_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_domain_topic_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/advanced_filter.rb new file mode 100644 index 000000000..4e16ba754 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/advanced_filter.rb @@ -0,0 +1,74 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # This is the base type that represents an advanced filter. To configure an + # advanced filter, do not directly instantiate an object of this class. + # Instead, instantiate an object of a derived class such as + # BoolEqualsAdvancedFilter, NumberInAdvancedFilter, + # StringEqualsAdvancedFilter etc. depending on the type of the key based on + # which you want to filter. + # + class AdvancedFilter + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["NumberIn"] = "NumberInAdvancedFilter" + @@discriminatorMap["NumberNotIn"] = "NumberNotInAdvancedFilter" + @@discriminatorMap["NumberLessThan"] = "NumberLessThanAdvancedFilter" + @@discriminatorMap["NumberGreaterThan"] = "NumberGreaterThanAdvancedFilter" + @@discriminatorMap["NumberLessThanOrEquals"] = "NumberLessThanOrEqualsAdvancedFilter" + @@discriminatorMap["NumberGreaterThanOrEquals"] = "NumberGreaterThanOrEqualsAdvancedFilter" + @@discriminatorMap["BoolEquals"] = "BoolEqualsAdvancedFilter" + @@discriminatorMap["StringIn"] = "StringInAdvancedFilter" + @@discriminatorMap["StringNotIn"] = "StringNotInAdvancedFilter" + @@discriminatorMap["StringBeginsWith"] = "StringBeginsWithAdvancedFilter" + @@discriminatorMap["StringEndsWith"] = "StringEndsWithAdvancedFilter" + @@discriminatorMap["StringContains"] = "StringContainsAdvancedFilter" + + def initialize + @operatorType = "AdvancedFilter" + end + + attr_accessor :operatorType + + # @return [String] The field/property in the event based on which you + # want to filter. + attr_accessor :key + + + # + # Mapper for AdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AdvancedFilter', + type: { + name: 'Composite', + polymorphic_discriminator: 'operatorType', + uber_parent: 'AdvancedFilter', + class_name: 'AdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.rb new file mode 100644 index 000000000..486ddf22b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.rb @@ -0,0 +1,86 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about the azure function destination for an event + # subscription. + # + class AzureFunctionEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "AzureFunction" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource Id that represents the endpoint of + # the Azure Function destination of an event subscription. + attr_accessor :resource_id + + # @return [Integer] Maximum number of events per batch. + attr_accessor :max_events_per_batch + + # @return [Integer] Preferred batch size in Kilobytes. + attr_accessor :preferred_batch_size_in_kilobytes + + + # + # Mapper for AzureFunctionEventSubscriptionDestination class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AzureFunction', + type: { + name: 'Composite', + class_name: 'AzureFunctionEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + max_events_per_batch: { + client_side_validation: true, + required: false, + serialized_name: 'properties.maxEventsPerBatch', + type: { + name: 'Number' + } + }, + preferred_batch_size_in_kilobytes: { + client_side_validation: true, + required: false, + serialized_name: 'properties.preferredBatchSizeInKilobytes', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb new file mode 100644 index 000000000..2af083662 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # BoolEquals Advanced Filter. + # + class BoolEqualsAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "BoolEquals" + end + + attr_accessor :operatorType + + # @return [Boolean] The boolean filter value. + attr_accessor :value + + + # + # Mapper for BoolEqualsAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'BoolEquals', + type: { + name: 'Composite', + class_name: 'BoolEqualsAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/connection_state.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/connection_state.rb new file mode 100644 index 000000000..050912445 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/connection_state.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # ConnectionState information. + # + class ConnectionState + + include MsRestAzure + + # @return [PersistedConnectionStatus] Status of the connection. Possible + # values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + attr_accessor :status + + # @return [String] Description of the connection state. + attr_accessor :description + + # @return [String] Actions required (if any). + attr_accessor :actions_required + + + # + # Mapper for ConnectionState class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ConnectionState', + type: { + name: 'Composite', + class_name: 'ConnectionState', + model_properties: { + status: { + client_side_validation: true, + required: false, + serialized_name: 'status', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + actions_required: { + client_side_validation: true, + required: false, + serialized_name: 'actionsRequired', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb new file mode 100644 index 000000000..24fa4db05 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb @@ -0,0 +1,50 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about the dead letter destination for an event subscription. + # To configure a deadletter destination, do not directly instantiate an + # object of this class. Instead, instantiate an object of a derived class. + # Currently, StorageBlobDeadLetterDestination is the only class that + # derives from this class. + # + class DeadLetterDestination + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["StorageBlob"] = "StorageBlobDeadLetterDestination" + + def initialize + @endpointType = "DeadLetterDestination" + end + + attr_accessor :endpointType + + + # + # Mapper for DeadLetterDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DeadLetterDestination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'DeadLetterDestination', + class_name: 'DeadLetterDestination', + model_properties: { + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain.rb new file mode 100644 index 000000000..0c3dc2b51 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain.rb @@ -0,0 +1,212 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # EventGrid Domain. + # + class Domain < TrackedResource + + include MsRestAzure + + # @return [Array] List of private endpoint + # connections. + attr_accessor :private_endpoint_connections + + # @return [DomainProvisioningState] Provisioning state of the domain. + # Possible values include: 'Creating', 'Updating', 'Deleting', + # 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + # @return [String] Endpoint for the domain. + attr_accessor :endpoint + + # @return [InputSchema] This determines the format that Event Grid should + # expect for incoming events published to the domain. Possible values + # include: 'EventGridSchema', 'CustomEventSchema', + # 'CloudEventSchemaV1_0'. Default value: 'EventGridSchema' . + attr_accessor :input_schema + + # @return [InputSchemaMapping] Information about the InputSchemaMapping + # which specified the info about mapping event payload. + attr_accessor :input_schema_mapping + + # @return [String] Metric resource id for the domain. + attr_accessor :metric_resource_id + + # @return [PublicNetworkAccess] This determines if traffic is allowed + # over public network. By default it is enabled. + # You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' + attr_accessor :public_network_access + + # @return [Array] This can be used to restrict traffic + # from specific IPs instead of all IPs. Note: These are considered only + # if PublicNetworkAccess is enabled. + attr_accessor :inbound_ip_rules + + + # + # Mapper for Domain class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Domain', + type: { + name: 'Composite', + class_name: 'Domain', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + private_endpoint_connections: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateEndpointConnections', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnectionElementType', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection' + } + } + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.endpoint', + type: { + name: 'String' + } + }, + input_schema: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inputSchema', + default_value: 'EventGridSchema', + type: { + name: 'String' + } + }, + input_schema_mapping: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inputSchemaMapping', + type: { + name: 'Composite', + polymorphic_discriminator: 'inputSchemaMappingType', + uber_parent: 'InputSchemaMapping', + class_name: 'InputSchemaMapping' + } + }, + metric_resource_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.metricResourceId', + type: { + name: 'String' + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + type: { + name: 'String' + } + }, + inbound_ip_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inboundIpRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'InboundIpRuleElementType', + type: { + name: 'Composite', + class_name: 'InboundIpRule' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb new file mode 100644 index 000000000..d817d38ee --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for DomainProvisioningState + # + module DomainProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb new file mode 100644 index 000000000..fb3f3cb5d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Domain regenerate share access key request. + # + class DomainRegenerateKeyRequest + + include MsRestAzure + + # @return [String] Key name to regenerate key1 or key2. + attr_accessor :key_name + + + # + # Mapper for DomainRegenerateKeyRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainRegenerateKeyRequest', + type: { + name: 'Composite', + class_name: 'DomainRegenerateKeyRequest', + model_properties: { + key_name: { + client_side_validation: true, + required: true, + serialized_name: 'keyName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb new file mode 100644 index 000000000..1afa8057d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Shared access keys of the Domain. + # + class DomainSharedAccessKeys + + include MsRestAzure + + # @return [String] Shared access key1 for the domain. + attr_accessor :key1 + + # @return [String] Shared access key2 for the domain. + attr_accessor :key2 + + + # + # Mapper for DomainSharedAccessKeys class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainSharedAccessKeys', + type: { + name: 'Composite', + class_name: 'DomainSharedAccessKeys', + model_properties: { + key1: { + client_side_validation: true, + required: false, + serialized_name: 'key1', + type: { + name: 'String' + } + }, + key2: { + client_side_validation: true, + required: false, + serialized_name: 'key2', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic.rb new file mode 100644 index 000000000..c4c2f5cfb --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic.rb @@ -0,0 +1,75 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Domain Topic. + # + class DomainTopic < Resource + + include MsRestAzure + + # @return [DomainTopicProvisioningState] Provisioning state of the domain + # topic. Possible values include: 'Creating', 'Updating', 'Deleting', + # 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + + # + # Mapper for DomainTopic class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainTopic', + type: { + name: 'Composite', + class_name: 'DomainTopic', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb new file mode 100644 index 000000000..6f71ba751 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for DomainTopicProvisioningState + # + module DomainTopicProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb new file mode 100644 index 000000000..65c905c15 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Result of the List Domain Topics operation. + # + class DomainTopicsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of Domain Topics. + attr_accessor :value + + # @return [String] A link for the next page of domain topics. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [DomainTopicsListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for DomainTopicsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainTopicsListResult', + type: { + name: 'Composite', + class_name: 'DomainTopicsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DomainTopicElementType', + type: { + name: 'Composite', + class_name: 'DomainTopic' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb new file mode 100644 index 000000000..90b0a3561 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb @@ -0,0 +1,91 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Properties of the Domain update. + # + class DomainUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] Tags of the domains resource. + attr_accessor :tags + + # @return [PublicNetworkAccess] This determines if traffic is allowed + # over public network. By default it is enabled. + # You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' + attr_accessor :public_network_access + + # @return [Array] This can be used to restrict traffic + # from specific IPs instead of all IPs. Note: These are considered only + # if PublicNetworkAccess is enabled. + attr_accessor :inbound_ip_rules + + + # + # Mapper for DomainUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainUpdateParameters', + type: { + name: 'Composite', + class_name: 'DomainUpdateParameters', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + type: { + name: 'String' + } + }, + inbound_ip_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inboundIpRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'InboundIpRuleElementType', + type: { + name: 'Composite', + class_name: 'InboundIpRule' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domains_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domains_list_result.rb new file mode 100644 index 000000000..8d44859c0 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domains_list_result.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Result of the List Domains operation. + # + class DomainsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of Domains. + attr_accessor :value + + # @return [String] A link for the next page of domains. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [DomainsListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for DomainsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainsListResult', + type: { + name: 'Composite', + class_name: 'DomainsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DomainElementType', + type: { + name: 'Composite', + class_name: 'Domain' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb new file mode 100644 index 000000000..bc4a94566 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for EventDeliverySchema + # + module EventDeliverySchema + EventGridSchema = "EventGridSchema" + CustomInputSchema = "CustomInputSchema" + CloudEventSchemaV10 = "CloudEventSchemaV1_0" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb new file mode 100644 index 000000000..acfcff7fb --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb @@ -0,0 +1,62 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about the event hub destination for an event subscription. + # + class EventHubEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "EventHub" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource Id that represents the endpoint of + # an Event Hub destination of an event subscription. + attr_accessor :resource_id + + + # + # Mapper for EventHubEventSubscriptionDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventHub', + type: { + name: 'Composite', + class_name: 'EventHubEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription.rb new file mode 100644 index 000000000..3f842ba04 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription.rb @@ -0,0 +1,189 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Event Subscription + # + class EventSubscription < Resource + + include MsRestAzure + + # @return [String] Name of the topic of the event subscription. + attr_accessor :topic + + # @return [EventSubscriptionProvisioningState] Provisioning state of the + # event subscription. Possible values include: 'Creating', 'Updating', + # 'Deleting', 'Succeeded', 'Canceled', 'Failed', 'AwaitingManualAction' + attr_accessor :provisioning_state + + # @return [EventSubscriptionDestination] Information about the + # destination where events have to be delivered for the event + # subscription. + attr_accessor :destination + + # @return [EventSubscriptionFilter] Information about the filter for the + # event subscription. + attr_accessor :filter + + # @return [Array] List of user defined labels. + attr_accessor :labels + + # @return [DateTime] Expiration time of the event subscription. + attr_accessor :expiration_time_utc + + # @return [EventDeliverySchema] The event delivery schema for the event + # subscription. Possible values include: 'EventGridSchema', + # 'CustomInputSchema', 'CloudEventSchemaV1_0' + attr_accessor :event_delivery_schema + + # @return [RetryPolicy] The retry policy for events. This can be used to + # configure maximum number of delivery attempts and time to live for + # events. + attr_accessor :retry_policy + + # @return [DeadLetterDestination] The DeadLetter destination of the event + # subscription. + attr_accessor :dead_letter_destination + + + # + # Mapper for EventSubscription class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscription', + type: { + name: 'Composite', + class_name: 'EventSubscription', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + topic: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.topic', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + destination: { + client_side_validation: true, + required: false, + serialized_name: 'properties.destination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'EventSubscriptionDestination', + class_name: 'EventSubscriptionDestination' + } + }, + filter: { + client_side_validation: true, + required: false, + serialized_name: 'properties.filter', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFilter' + } + }, + labels: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labels', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + expiration_time_utc: { + client_side_validation: true, + required: false, + serialized_name: 'properties.expirationTimeUtc', + type: { + name: 'DateTime' + } + }, + event_delivery_schema: { + client_side_validation: true, + required: false, + serialized_name: 'properties.eventDeliverySchema', + type: { + name: 'String' + } + }, + retry_policy: { + client_side_validation: true, + required: false, + serialized_name: 'properties.retryPolicy', + type: { + name: 'Composite', + class_name: 'RetryPolicy' + } + }, + dead_letter_destination: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deadLetterDestination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'DeadLetterDestination', + class_name: 'DeadLetterDestination' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb new file mode 100644 index 000000000..28eca0d8d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb @@ -0,0 +1,52 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about the destination for an event subscription. + # + class EventSubscriptionDestination + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["WebHook"] = "WebHookEventSubscriptionDestination" + @@discriminatorMap["EventHub"] = "EventHubEventSubscriptionDestination" + @@discriminatorMap["StorageQueue"] = "StorageQueueEventSubscriptionDestination" + @@discriminatorMap["HybridConnection"] = "HybridConnectionEventSubscriptionDestination" + @@discriminatorMap["ServiceBusQueue"] = "ServiceBusQueueEventSubscriptionDestination" + @@discriminatorMap["ServiceBusTopic"] = "ServiceBusTopicEventSubscriptionDestination" + @@discriminatorMap["AzureFunction"] = "AzureFunctionEventSubscriptionDestination" + + def initialize + @endpointType = "EventSubscriptionDestination" + end + + attr_accessor :endpointType + + + # + # Mapper for EventSubscriptionDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionDestination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'EventSubscriptionDestination', + class_name: 'EventSubscriptionDestination', + model_properties: { + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb new file mode 100644 index 000000000..182a2fa60 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb @@ -0,0 +1,120 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Filter for the Event Subscription. + # + class EventSubscriptionFilter + + include MsRestAzure + + # @return [String] An optional string to filter events for an event + # subscription based on a resource path prefix. + # The format of this depends on the publisher of the events. + # Wildcard characters are not supported in this path. + attr_accessor :subject_begins_with + + # @return [String] An optional string to filter events for an event + # subscription based on a resource path suffix. + # Wildcard characters are not supported in this path. + attr_accessor :subject_ends_with + + # @return [Array] A list of applicable event types that need to + # be part of the event subscription. If it is desired to subscribe to all + # default event types, set the IncludedEventTypes to null. + attr_accessor :included_event_types + + # @return [Boolean] Specifies if the SubjectBeginsWith and + # SubjectEndsWith properties of the filter + # should be compared in a case sensitive manner. Default value: false . + attr_accessor :is_subject_case_sensitive + + # @return [Array] An array of advanced filters that are + # used for filtering event subscriptions. + attr_accessor :advanced_filters + + + # + # Mapper for EventSubscriptionFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionFilter', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFilter', + model_properties: { + subject_begins_with: { + client_side_validation: true, + required: false, + serialized_name: 'subjectBeginsWith', + type: { + name: 'String' + } + }, + subject_ends_with: { + client_side_validation: true, + required: false, + serialized_name: 'subjectEndsWith', + type: { + name: 'String' + } + }, + included_event_types: { + client_side_validation: true, + required: false, + serialized_name: 'includedEventTypes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + is_subject_case_sensitive: { + client_side_validation: true, + required: false, + serialized_name: 'isSubjectCaseSensitive', + default_value: false, + type: { + name: 'Boolean' + } + }, + advanced_filters: { + client_side_validation: true, + required: false, + serialized_name: 'advancedFilters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'AdvancedFilterElementType', + type: { + name: 'Composite', + polymorphic_discriminator: 'operatorType', + uber_parent: 'AdvancedFilter', + class_name: 'AdvancedFilter' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb new file mode 100644 index 000000000..4ec0e27cd --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Full endpoint url of an event subscription + # + class EventSubscriptionFullUrl + + include MsRestAzure + + # @return [String] The URL that represents the endpoint of the + # destination of an event subscription. + attr_accessor :endpoint_url + + + # + # Mapper for EventSubscriptionFullUrl class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionFullUrl', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFullUrl', + model_properties: { + endpoint_url: { + client_side_validation: true, + required: false, + serialized_name: 'endpointUrl', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb new file mode 100644 index 000000000..1ac5bd49f --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb @@ -0,0 +1,21 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for EventSubscriptionProvisioningState + # + module EventSubscriptionProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + AwaitingManualAction = "AwaitingManualAction" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb new file mode 100644 index 000000000..17bc1aa07 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb @@ -0,0 +1,137 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Properties of the Event Subscription update. + # + class EventSubscriptionUpdateParameters + + include MsRestAzure + + # @return [EventSubscriptionDestination] Information about the + # destination where events have to be delivered for the event + # subscription. + attr_accessor :destination + + # @return [EventSubscriptionFilter] Information about the filter for the + # event subscription. + attr_accessor :filter + + # @return [Array] List of user defined labels. + attr_accessor :labels + + # @return [DateTime] Information about the expiration time for the event + # subscription. + attr_accessor :expiration_time_utc + + # @return [EventDeliverySchema] The event delivery schema for the event + # subscription. Possible values include: 'EventGridSchema', + # 'CustomInputSchema', 'CloudEventSchemaV1_0' + attr_accessor :event_delivery_schema + + # @return [RetryPolicy] The retry policy for events. This can be used to + # configure maximum number of delivery attempts and time to live for + # events. + attr_accessor :retry_policy + + # @return [DeadLetterDestination] The DeadLetter destination of the event + # subscription. + attr_accessor :dead_letter_destination + + + # + # Mapper for EventSubscriptionUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionUpdateParameters', + type: { + name: 'Composite', + class_name: 'EventSubscriptionUpdateParameters', + model_properties: { + destination: { + client_side_validation: true, + required: false, + serialized_name: 'destination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'EventSubscriptionDestination', + class_name: 'EventSubscriptionDestination' + } + }, + filter: { + client_side_validation: true, + required: false, + serialized_name: 'filter', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFilter' + } + }, + labels: { + client_side_validation: true, + required: false, + serialized_name: 'labels', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + expiration_time_utc: { + client_side_validation: true, + required: false, + serialized_name: 'expirationTimeUtc', + type: { + name: 'DateTime' + } + }, + event_delivery_schema: { + client_side_validation: true, + required: false, + serialized_name: 'eventDeliverySchema', + type: { + name: 'String' + } + }, + retry_policy: { + client_side_validation: true, + required: false, + serialized_name: 'retryPolicy', + type: { + name: 'Composite', + class_name: 'RetryPolicy' + } + }, + dead_letter_destination: { + client_side_validation: true, + required: false, + serialized_name: 'deadLetterDestination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'DeadLetterDestination', + class_name: 'DeadLetterDestination' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb new file mode 100644 index 000000000..6ad7c0d35 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Result of the List EventSubscriptions operation + # + class EventSubscriptionsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of EventSubscriptions + attr_accessor :value + + # @return [String] A link for the next page of event subscriptions + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [EventSubscriptionsListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for EventSubscriptionsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionsListResult', + type: { + name: 'Composite', + class_name: 'EventSubscriptionsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionElementType', + type: { + name: 'Composite', + class_name: 'EventSubscription' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_type.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_type.rb new file mode 100644 index 000000000..dce322d16 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_type.rb @@ -0,0 +1,106 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Event Type for a subject under a topic + # + class EventType < Resource + + include MsRestAzure + + # @return [String] Display name of the event type. + attr_accessor :display_name + + # @return [String] Description of the event type. + attr_accessor :description + + # @return [String] Url of the schema for this event type. + attr_accessor :schema_url + + # @return [Boolean] IsInDefaultSet flag of the event type. + attr_accessor :is_in_default_set + + + # + # Mapper for EventType class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventType', + type: { + name: 'Composite', + class_name: 'EventType', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + schema_url: { + client_side_validation: true, + required: false, + serialized_name: 'properties.schemaUrl', + type: { + name: 'String' + } + }, + is_in_default_set: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isInDefaultSet', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_types_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_types_list_result.rb new file mode 100644 index 000000000..435e7d153 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_types_list_result.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Result of the List Event Types operation + # + class EventTypesListResult + + include MsRestAzure + + # @return [Array] A collection of event types + attr_accessor :value + + + # + # Mapper for EventTypesListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventTypesListResult', + type: { + name: 'Composite', + class_name: 'EventTypesListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EventTypeElementType', + type: { + name: 'Composite', + class_name: 'EventType' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb new file mode 100644 index 000000000..b962d0a42 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb @@ -0,0 +1,64 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about the HybridConnection destination for an event + # subscription. + # + class HybridConnectionEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "HybridConnection" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource ID of an hybrid connection that is + # the destination of an event subscription. + attr_accessor :resource_id + + + # + # Mapper for HybridConnectionEventSubscriptionDestination class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'HybridConnection', + type: { + name: 'Composite', + class_name: 'HybridConnectionEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/inbound_ip_rule.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/inbound_ip_rule.rb new file mode 100644 index 000000000..640031fe9 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/inbound_ip_rule.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Model object. + # + # + class InboundIpRule + + include MsRestAzure + + # @return [String] IP Address in CIDR notation e.g., 10.0.0.0/8. + attr_accessor :ip_mask + + # @return [IpActionType] Action to perform based on the match or no match + # of the IpMask. Possible values include: 'Allow' + attr_accessor :action + + + # + # Mapper for InboundIpRule class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'InboundIpRule', + type: { + name: 'Composite', + class_name: 'InboundIpRule', + model_properties: { + ip_mask: { + client_side_validation: true, + required: false, + serialized_name: 'ipMask', + type: { + name: 'String' + } + }, + action: { + client_side_validation: true, + required: false, + serialized_name: 'action', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/input_schema.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/input_schema.rb new file mode 100644 index 000000000..21b508b86 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/input_schema.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for InputSchema + # + module InputSchema + EventGridSchema = "EventGridSchema" + CustomEventSchema = "CustomEventSchema" + CloudEventSchemaV10 = "CloudEventSchemaV1_0" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb new file mode 100644 index 000000000..cb5fea5c9 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb @@ -0,0 +1,49 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # By default, Event Grid expects events to be in the Event Grid event + # schema. Specifying an input schema mapping enables publishing to Event + # Grid using a custom input schema. Currently, the only supported type of + # InputSchemaMapping is 'JsonInputSchemaMapping'. + # + class InputSchemaMapping + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["Json"] = "JsonInputSchemaMapping" + + def initialize + @inputSchemaMappingType = "InputSchemaMapping" + end + + attr_accessor :inputSchemaMappingType + + + # + # Mapper for InputSchemaMapping class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'InputSchemaMapping', + type: { + name: 'Composite', + polymorphic_discriminator: 'inputSchemaMappingType', + uber_parent: 'InputSchemaMapping', + class_name: 'InputSchemaMapping', + model_properties: { + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/ip_action_type.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/ip_action_type.rb new file mode 100644 index 000000000..5d46b5575 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/ip_action_type.rb @@ -0,0 +1,15 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for IpActionType + # + module IpActionType + Allow = "Allow" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_field.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_field.rb new file mode 100644 index 000000000..fde85b4cd --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_field.rb @@ -0,0 +1,50 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # This is used to express the source of an input schema mapping for a + # single target field in the Event Grid Event schema. This is currently + # used in the mappings for the 'id', 'topic' and 'eventtime' properties. + # This represents a field in the input event schema. + # + class JsonField + + include MsRestAzure + + # @return [String] Name of a field in the input event schema that's to be + # used as the source of a mapping. + attr_accessor :source_field + + + # + # Mapper for JsonField class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JsonField', + type: { + name: 'Composite', + class_name: 'JsonField', + model_properties: { + source_field: { + client_side_validation: true, + required: false, + serialized_name: 'sourceField', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_field_with_default.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_field_with_default.rb new file mode 100644 index 000000000..628d09962 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_field_with_default.rb @@ -0,0 +1,67 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # This is used to express the source of an input schema mapping for a + # single target field + # in the Event Grid Event schema. This is currently used in the mappings + # for the 'subject', + # 'eventtype' and 'dataversion' properties. This represents a field in the + # input event schema + # along with a default value to be used, and at least one of these two + # properties should be provided. + # + class JsonFieldWithDefault + + include MsRestAzure + + # @return [String] Name of a field in the input event schema that's to be + # used as the source of a mapping. + attr_accessor :source_field + + # @return [String] The default value to be used for mapping when a + # SourceField is not provided or if there's no property with the + # specified name in the published JSON event payload. + attr_accessor :default_value + + + # + # Mapper for JsonFieldWithDefault class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JsonFieldWithDefault', + type: { + name: 'Composite', + class_name: 'JsonFieldWithDefault', + model_properties: { + source_field: { + client_side_validation: true, + required: false, + serialized_name: 'sourceField', + type: { + name: 'String' + } + }, + default_value: { + client_side_validation: true, + required: false, + serialized_name: 'defaultValue', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb new file mode 100644 index 000000000..60b62ac5a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb @@ -0,0 +1,130 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # This enables publishing to Event Grid using a custom input schema. This + # can be used to map properties from a custom input JSON schema to the + # Event Grid event schema. + # + class JsonInputSchemaMapping < InputSchemaMapping + + include MsRestAzure + + + def initialize + @inputSchemaMappingType = "Json" + end + + attr_accessor :inputSchemaMappingType + + # @return [JsonField] The mapping information for the Id property of the + # Event Grid Event. + attr_accessor :id + + # @return [JsonField] The mapping information for the Topic property of + # the Event Grid Event. + attr_accessor :topic + + # @return [JsonField] The mapping information for the EventTime property + # of the Event Grid Event. + attr_accessor :event_time + + # @return [JsonFieldWithDefault] The mapping information for the + # EventType property of the Event Grid Event. + attr_accessor :event_type + + # @return [JsonFieldWithDefault] The mapping information for the Subject + # property of the Event Grid Event. + attr_accessor :subject + + # @return [JsonFieldWithDefault] The mapping information for the + # DataVersion property of the Event Grid Event. + attr_accessor :data_version + + + # + # Mapper for JsonInputSchemaMapping class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Json', + type: { + name: 'Composite', + class_name: 'JsonInputSchemaMapping', + model_properties: { + inputSchemaMappingType: { + client_side_validation: true, + required: true, + serialized_name: 'inputSchemaMappingType', + type: { + name: 'String' + } + }, + id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.id', + type: { + name: 'Composite', + class_name: 'JsonField' + } + }, + topic: { + client_side_validation: true, + required: false, + serialized_name: 'properties.topic', + type: { + name: 'Composite', + class_name: 'JsonField' + } + }, + event_time: { + client_side_validation: true, + required: false, + serialized_name: 'properties.eventTime', + type: { + name: 'Composite', + class_name: 'JsonField' + } + }, + event_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.eventType', + type: { + name: 'Composite', + class_name: 'JsonFieldWithDefault' + } + }, + subject: { + client_side_validation: true, + required: false, + serialized_name: 'properties.subject', + type: { + name: 'Composite', + class_name: 'JsonFieldWithDefault' + } + }, + data_version: { + client_side_validation: true, + required: false, + serialized_name: 'properties.dataVersion', + type: { + name: 'Composite', + class_name: 'JsonFieldWithDefault' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb new file mode 100644 index 000000000..7d427561e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # NumberGreaterThan Advanced Filter. + # + class NumberGreaterThanAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberGreaterThan" + end + + attr_accessor :operatorType + + # @return [Float] The filter value. + attr_accessor :value + + + # + # Mapper for NumberGreaterThanAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberGreaterThan', + type: { + name: 'Composite', + class_name: 'NumberGreaterThanAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb new file mode 100644 index 000000000..cea3c1fc9 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # NumberGreaterThanOrEquals Advanced Filter. + # + class NumberGreaterThanOrEqualsAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberGreaterThanOrEquals" + end + + attr_accessor :operatorType + + # @return [Float] The filter value. + attr_accessor :value + + + # + # Mapper for NumberGreaterThanOrEqualsAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberGreaterThanOrEquals', + type: { + name: 'Composite', + class_name: 'NumberGreaterThanOrEqualsAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb new file mode 100644 index 000000000..46050b9cc --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # NumberIn Advanced Filter. + # + class NumberInAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberIn" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for NumberInAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberIn', + type: { + name: 'Composite', + class_name: 'NumberInAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FloatElementType', + type: { + name: 'Double' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb new file mode 100644 index 000000000..dca173bf7 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # NumberLessThan Advanced Filter. + # + class NumberLessThanAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberLessThan" + end + + attr_accessor :operatorType + + # @return [Float] The filter value. + attr_accessor :value + + + # + # Mapper for NumberLessThanAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberLessThan', + type: { + name: 'Composite', + class_name: 'NumberLessThanAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb new file mode 100644 index 000000000..6559b9737 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # NumberLessThanOrEquals Advanced Filter. + # + class NumberLessThanOrEqualsAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberLessThanOrEquals" + end + + attr_accessor :operatorType + + # @return [Float] The filter value. + attr_accessor :value + + + # + # Mapper for NumberLessThanOrEqualsAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberLessThanOrEquals', + type: { + name: 'Composite', + class_name: 'NumberLessThanOrEqualsAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb new file mode 100644 index 000000000..99e3aa64c --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # NumberNotIn Advanced Filter. + # + class NumberNotInAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberNotIn" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for NumberNotInAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberNotIn', + type: { + name: 'Composite', + class_name: 'NumberNotInAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FloatElementType', + type: { + name: 'Double' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operation.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operation.rb new file mode 100644 index 000000000..0dcb39063 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operation.rb @@ -0,0 +1,80 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Represents an operation returned by the GetOperations request + # + class Operation + + include MsRestAzure + + # @return [String] Name of the operation + attr_accessor :name + + # @return [OperationInfo] Display name of the operation + attr_accessor :display + + # @return [String] Origin of the operation + attr_accessor :origin + + # @return Properties of the operation + attr_accessor :properties + + + # + # Mapper for Operation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Operation', + type: { + name: 'Composite', + class_name: 'Operation', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + client_side_validation: true, + required: false, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationInfo' + } + }, + origin: { + client_side_validation: true, + required: false, + serialized_name: 'origin', + type: { + name: 'String' + } + }, + properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operation_info.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operation_info.rb new file mode 100644 index 000000000..756717745 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operation_info.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about an operation + # + class OperationInfo + + include MsRestAzure + + # @return [String] Name of the provider + attr_accessor :provider + + # @return [String] Name of the resource type + attr_accessor :resource + + # @return [String] Name of the operation + attr_accessor :operation + + # @return [String] Description of the operation + attr_accessor :description + + + # + # Mapper for OperationInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationInfo', + type: { + name: 'Composite', + class_name: 'OperationInfo', + model_properties: { + provider: { + client_side_validation: true, + required: false, + serialized_name: 'provider', + type: { + name: 'String' + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'resource', + type: { + name: 'String' + } + }, + operation: { + client_side_validation: true, + required: false, + serialized_name: 'operation', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/host_info_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operations_list_result.rb similarity index 69% rename from management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/host_info_list_result.rb rename to management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operations_list_result.rb index dffdcaf27..9978f0b1d 100644 --- a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/host_info_list_result.rb +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operations_list_result.rb @@ -3,31 +3,31 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. -module Azure::Hdinsight::Mgmt::V2018_06_01_preview +module Azure::EventGrid::Mgmt::V2020_06_01 module Models # - # Result of the request to list cluster hosts + # Result of the List Operations operation # - class HostInfoListResult + class OperationsListResult include MsRestAzure - # @return [Array] The list of cluster hosts. + # @return [Array] A collection of operations attr_accessor :value # - # Mapper for HostInfoListResult class as Ruby Hash. + # Mapper for OperationsListResult class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, - serialized_name: 'HostInfoListResult', + serialized_name: 'OperationsListResult', type: { name: 'Composite', - class_name: 'HostInfoListResult', + class_name: 'OperationsListResult', model_properties: { value: { client_side_validation: true, @@ -38,10 +38,10 @@ module Azure::Hdinsight::Mgmt::V2018_06_01_preview element: { client_side_validation: true, required: false, - serialized_name: 'HostInfoElementType', + serialized_name: 'OperationElementType', type: { name: 'Composite', - class_name: 'HostInfo' + class_name: 'Operation' } } } diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/persisted_connection_status.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/persisted_connection_status.rb new file mode 100644 index 000000000..8a7add2c3 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/persisted_connection_status.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for PersistedConnectionStatus + # + module PersistedConnectionStatus + Pending = "Pending" + Approved = "Approved" + Rejected = "Rejected" + Disconnected = "Disconnected" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint.rb new file mode 100644 index 000000000..bced83523 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # PrivateEndpoint information. + # + class PrivateEndpoint + + include MsRestAzure + + # @return [String] The ARM identifier for Private Endpoint. + attr_accessor :id + + + # + # Mapper for PrivateEndpoint class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpoint', + type: { + name: 'Composite', + class_name: 'PrivateEndpoint', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection.rb new file mode 100644 index 000000000..30a8f5837 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection.rb @@ -0,0 +1,121 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Model object. + # + # + class PrivateEndpointConnection < Resource + + include MsRestAzure + + # @return [PrivateEndpoint] The Private Endpoint resource for this + # Connection. + attr_accessor :private_endpoint + + # @return [Array] GroupIds from the private link service + # resource. + attr_accessor :group_ids + + # @return [ConnectionState] Details about the state of the connection. + attr_accessor :private_link_service_connection_state + + # @return [ResourceProvisioningState] Provisioning state of the Private + # Endpoint Connection. Possible values include: 'Creating', 'Updating', + # 'Deleting', 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + + # + # Mapper for PrivateEndpointConnection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnection', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + private_endpoint: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateEndpoint', + type: { + name: 'Composite', + class_name: 'PrivateEndpoint' + } + }, + group_ids: { + client_side_validation: true, + required: false, + serialized_name: 'properties.groupIds', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + private_link_service_connection_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateLinkServiceConnectionState', + type: { + name: 'Composite', + class_name: 'ConnectionState' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection_list_result.rb new file mode 100644 index 000000000..38b0933e2 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection_list_result.rb @@ -0,0 +1,100 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Result of the list of all private endpoint connections operation. + # + class PrivateEndpointConnectionListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of private + # endpoint connection resources. + attr_accessor :value + + # @return [String] A link for the next page of private endpoint + # connection resources. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [PrivateEndpointConnectionListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for PrivateEndpointConnectionListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnectionListResult', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnectionListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnectionElementType', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resource.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resource.rb new file mode 100644 index 000000000..2fc6390ed --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resource.rb @@ -0,0 +1,128 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information of the private link resource. + # + class PrivateLinkResource + + include MsRestAzure + + # @return [String] + attr_accessor :group_id + + # @return [String] + attr_accessor :display_name + + # @return [Array] + attr_accessor :required_members + + # @return [Array] + attr_accessor :required_zone_names + + # @return [String] Fully qualified identifier of the resource. + attr_accessor :id + + # @return [String] Name of the resource + attr_accessor :name + + # @return [String] Type of the resource + attr_accessor :type + + + # + # Mapper for PrivateLinkResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateLinkResource', + type: { + name: 'Composite', + class_name: 'PrivateLinkResource', + model_properties: { + group_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.groupId', + type: { + name: 'String' + } + }, + display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + required_members: { + client_side_validation: true, + required: false, + serialized_name: 'properties.requiredMembers', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + required_zone_names: { + client_side_validation: true, + required: false, + serialized_name: 'properties.requiredZoneNames', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resources_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resources_list_result.rb new file mode 100644 index 000000000..832b13b67 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resources_list_result.rb @@ -0,0 +1,99 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Result of the List private link resources operation. + # + class PrivateLinkResourcesListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of private link + # resources + attr_accessor :value + + # @return [String] A link for the next page of private link resources. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [PrivateLinkResourcesListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for PrivateLinkResourcesListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateLinkResourcesListResult', + type: { + name: 'Composite', + class_name: 'PrivateLinkResourcesListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PrivateLinkResourceElementType', + type: { + name: 'Composite', + class_name: 'PrivateLinkResource' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/public_network_access.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/public_network_access.rb new file mode 100644 index 000000000..906cdb4b7 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/public_network_access.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for PublicNetworkAccess + # + module PublicNetworkAccess + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource.rb new file mode 100644 index 000000000..634898c82 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource.rb @@ -0,0 +1,80 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Definition of a Resource. + # + class Resource + + include MsRestAzure + + # @return [String] Fully qualified identifier of the resource. + attr_accessor :id + + # @return [String] Name of the resource. + attr_accessor :name + + # @return [String] Type of the resource. + attr_accessor :type + + + # @return [String] the name of the resource group of the resource. + def resource_group + unless self.id.nil? + groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/) + groups.captures[0].strip if groups + end + end + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource_provisioning_state.rb new file mode 100644 index 000000000..7a352fd50 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource_provisioning_state.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for ResourceProvisioningState + # + module ResourceProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource_region_type.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource_region_type.rb new file mode 100644 index 000000000..fc834d0ff --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource_region_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for ResourceRegionType + # + module ResourceRegionType + RegionalResource = "RegionalResource" + GlobalResource = "GlobalResource" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/retry_policy.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/retry_policy.rb new file mode 100644 index 000000000..35ba39090 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/retry_policy.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about the retry policy for an event subscription. + # + class RetryPolicy + + include MsRestAzure + + # @return [Integer] Maximum number of delivery retry attempts for events. + attr_accessor :max_delivery_attempts + + # @return [Integer] Time To Live (in minutes) for events. + attr_accessor :event_time_to_live_in_minutes + + + # + # Mapper for RetryPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'RetryPolicy', + type: { + name: 'Composite', + class_name: 'RetryPolicy', + model_properties: { + max_delivery_attempts: { + client_side_validation: true, + required: false, + serialized_name: 'maxDeliveryAttempts', + type: { + name: 'Number' + } + }, + event_time_to_live_in_minutes: { + client_side_validation: true, + required: false, + serialized_name: 'eventTimeToLiveInMinutes', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb new file mode 100644 index 000000000..2105d31da --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb @@ -0,0 +1,63 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about the service bus destination for an event subscription. + # + class ServiceBusQueueEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "ServiceBusQueue" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource Id that represents the endpoint of + # the Service Bus destination of an event subscription. + attr_accessor :resource_id + + + # + # Mapper for ServiceBusQueueEventSubscriptionDestination class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ServiceBusQueue', + type: { + name: 'Composite', + class_name: 'ServiceBusQueueEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb new file mode 100644 index 000000000..fefd45679 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb @@ -0,0 +1,64 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about the service bus topic destination for an event + # subscription. + # + class ServiceBusTopicEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "ServiceBusTopic" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource Id that represents the endpoint of + # the Service Bus Topic destination of an event subscription. + attr_accessor :resource_id + + + # + # Mapper for ServiceBusTopicEventSubscriptionDestination class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ServiceBusTopic', + type: { + name: 'Composite', + class_name: 'ServiceBusTopicEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb new file mode 100644 index 000000000..f7c2b225c --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb @@ -0,0 +1,74 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about the storage blob based dead letter destination. + # + class StorageBlobDeadLetterDestination < DeadLetterDestination + + include MsRestAzure + + + def initialize + @endpointType = "StorageBlob" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource ID of the storage account that is + # the destination of the deadletter events + attr_accessor :resource_id + + # @return [String] The name of the Storage blob container that is the + # destination of the deadletter events + attr_accessor :blob_container_name + + + # + # Mapper for StorageBlobDeadLetterDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'StorageBlob', + type: { + name: 'Composite', + class_name: 'StorageBlobDeadLetterDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + blob_container_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.blobContainerName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb new file mode 100644 index 000000000..48d44f2cb --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb @@ -0,0 +1,75 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about the storage queue destination for an event + # subscription. + # + class StorageQueueEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "StorageQueue" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource ID of the storage account that + # contains the queue that is the destination of an event subscription. + attr_accessor :resource_id + + # @return [String] The name of the Storage queue under a storage account + # that is the destination of an event subscription. + attr_accessor :queue_name + + + # + # Mapper for StorageQueueEventSubscriptionDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'StorageQueue', + type: { + name: 'Composite', + class_name: 'StorageQueueEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + queue_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.queueName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb new file mode 100644 index 000000000..0b6c3c7ee --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # StringBeginsWith Advanced Filter. + # + class StringBeginsWithAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringBeginsWith" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringBeginsWithAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'StringBeginsWith', + type: { + name: 'Composite', + class_name: 'StringBeginsWithAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb new file mode 100644 index 000000000..e4af260b2 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # StringContains Advanced Filter. + # + class StringContainsAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringContains" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringContainsAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'StringContains', + type: { + name: 'Composite', + class_name: 'StringContainsAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb new file mode 100644 index 000000000..108b58e0d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # StringEndsWith Advanced Filter. + # + class StringEndsWithAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringEndsWith" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringEndsWithAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'StringEndsWith', + type: { + name: 'Composite', + class_name: 'StringEndsWithAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb new file mode 100644 index 000000000..1f7aef94f --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # StringIn Advanced Filter. + # + class StringInAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringIn" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringInAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'StringIn', + type: { + name: 'Composite', + class_name: 'StringInAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb new file mode 100644 index 000000000..08b33342c --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # StringNotIn Advanced Filter. + # + class StringNotInAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringNotIn" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringNotInAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'StringNotIn', + type: { + name: 'Composite', + class_name: 'StringNotInAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic.rb new file mode 100644 index 000000000..23edb34eb --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic.rb @@ -0,0 +1,213 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # EventGrid Topic + # + class Topic < TrackedResource + + include MsRestAzure + + # @return [Array] + attr_accessor :private_endpoint_connections + + # @return [TopicProvisioningState] Provisioning state of the topic. + # Possible values include: 'Creating', 'Updating', 'Deleting', + # 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + # @return [String] Endpoint for the topic. + attr_accessor :endpoint + + # @return [InputSchema] This determines the format that Event Grid should + # expect for incoming events published to the topic. Possible values + # include: 'EventGridSchema', 'CustomEventSchema', + # 'CloudEventSchemaV1_0'. Default value: 'EventGridSchema' . + attr_accessor :input_schema + + # @return [InputSchemaMapping] This enables publishing using custom event + # schemas. An InputSchemaMapping can be specified to map various + # properties of a source schema to various required properties of the + # EventGridEvent schema. + attr_accessor :input_schema_mapping + + # @return [String] Metric resource id for the topic. + attr_accessor :metric_resource_id + + # @return [PublicNetworkAccess] This determines if traffic is allowed + # over public network. By default it is enabled. + # You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' + attr_accessor :public_network_access + + # @return [Array] This can be used to restrict traffic + # from specific IPs instead of all IPs. Note: These are considered only + # if PublicNetworkAccess is enabled. + attr_accessor :inbound_ip_rules + + + # + # Mapper for Topic class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Topic', + type: { + name: 'Composite', + class_name: 'Topic', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + private_endpoint_connections: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateEndpointConnections', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnectionElementType', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection' + } + } + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.endpoint', + type: { + name: 'String' + } + }, + input_schema: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inputSchema', + default_value: 'EventGridSchema', + type: { + name: 'String' + } + }, + input_schema_mapping: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inputSchemaMapping', + type: { + name: 'Composite', + polymorphic_discriminator: 'inputSchemaMappingType', + uber_parent: 'InputSchemaMapping', + class_name: 'InputSchemaMapping' + } + }, + metric_resource_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.metricResourceId', + type: { + name: 'String' + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + type: { + name: 'String' + } + }, + inbound_ip_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inboundIpRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'InboundIpRuleElementType', + type: { + name: 'Composite', + class_name: 'InboundIpRule' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb new file mode 100644 index 000000000..e038ee5ca --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for TopicProvisioningState + # + module TopicProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb new file mode 100644 index 000000000..7e4370845 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Topic regenerate share access key request + # + class TopicRegenerateKeyRequest + + include MsRestAzure + + # @return [String] Key name to regenerate key1 or key2 + attr_accessor :key_name + + + # + # Mapper for TopicRegenerateKeyRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicRegenerateKeyRequest', + type: { + name: 'Composite', + class_name: 'TopicRegenerateKeyRequest', + model_properties: { + key_name: { + client_side_validation: true, + required: true, + serialized_name: 'keyName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb new file mode 100644 index 000000000..55fbcb06a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Shared access keys of the Topic + # + class TopicSharedAccessKeys + + include MsRestAzure + + # @return [String] Shared access key1 for the topic. + attr_accessor :key1 + + # @return [String] Shared access key2 for the topic. + attr_accessor :key2 + + + # + # Mapper for TopicSharedAccessKeys class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicSharedAccessKeys', + type: { + name: 'Composite', + class_name: 'TopicSharedAccessKeys', + model_properties: { + key1: { + client_side_validation: true, + required: false, + serialized_name: 'key1', + type: { + name: 'String' + } + }, + key2: { + client_side_validation: true, + required: false, + serialized_name: 'key2', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_info.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_info.rb new file mode 100644 index 000000000..da498cb32 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_info.rb @@ -0,0 +1,150 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Properties of a topic type info. + # + class TopicTypeInfo < Resource + + include MsRestAzure + + # @return [String] Namespace of the provider of the topic type. + attr_accessor :provider + + # @return [String] Display Name for the topic type. + attr_accessor :display_name + + # @return [String] Description of the topic type. + attr_accessor :description + + # @return [ResourceRegionType] Region type of the resource. Possible + # values include: 'RegionalResource', 'GlobalResource' + attr_accessor :resource_region_type + + # @return [TopicTypeProvisioningState] Provisioning state of the topic + # type. Possible values include: 'Creating', 'Updating', 'Deleting', + # 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + # @return [Array] List of locations supported by this topic type. + attr_accessor :supported_locations + + # @return [String] Source resource format. + attr_accessor :source_resource_format + + + # + # Mapper for TopicTypeInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicTypeInfo', + type: { + name: 'Composite', + class_name: 'TopicTypeInfo', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + provider: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provider', + type: { + name: 'String' + } + }, + display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + resource_region_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceRegionType', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + supported_locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.supportedLocations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + source_resource_format: { + client_side_validation: true, + required: false, + serialized_name: 'properties.sourceResourceFormat', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb new file mode 100644 index 000000000..25ef8de64 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Defines values for TopicTypeProvisioningState + # + module TopicTypeProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb new file mode 100644 index 000000000..720c8f632 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Result of the List Topic Types operation + # + class TopicTypesListResult + + include MsRestAzure + + # @return [Array] A collection of topic types + attr_accessor :value + + + # + # Mapper for TopicTypesListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicTypesListResult', + type: { + name: 'Composite', + class_name: 'TopicTypesListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TopicTypeInfoElementType', + type: { + name: 'Composite', + class_name: 'TopicTypeInfo' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb new file mode 100644 index 000000000..150c78aff --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb @@ -0,0 +1,91 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Properties of the Topic update + # + class TopicUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] Tags of the resource. + attr_accessor :tags + + # @return [PublicNetworkAccess] This determines if traffic is allowed + # over public network. By default it is enabled. + # You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' + attr_accessor :public_network_access + + # @return [Array] This can be used to restrict traffic + # from specific IPs instead of all IPs. Note: These are considered only + # if PublicNetworkAccess is enabled. + attr_accessor :inbound_ip_rules + + + # + # Mapper for TopicUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicUpdateParameters', + type: { + name: 'Composite', + class_name: 'TopicUpdateParameters', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + type: { + name: 'String' + } + }, + inbound_ip_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inboundIpRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'InboundIpRuleElementType', + type: { + name: 'Composite', + class_name: 'InboundIpRule' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topics_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topics_list_result.rb new file mode 100644 index 000000000..ebec3364d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topics_list_result.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Result of the List Topics operation + # + class TopicsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of Topics + attr_accessor :value + + # @return [String] A link for the next page of topics + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [TopicsListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for TopicsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicsListResult', + type: { + name: 'Composite', + class_name: 'TopicsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TopicElementType', + type: { + name: 'Composite', + class_name: 'Topic' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/tracked_resource.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/tracked_resource.rb new file mode 100644 index 000000000..515917bdc --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/tracked_resource.rb @@ -0,0 +1,92 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Definition of a Tracked Resource. + # + class TrackedResource < Resource + + include MsRestAzure + + # @return [String] Location of the resource. + attr_accessor :location + + # @return [Hash{String => String}] Tags of the resource. + attr_accessor :tags + + + # + # Mapper for TrackedResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TrackedResource', + type: { + name: 'Composite', + class_name: 'TrackedResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb new file mode 100644 index 000000000..ca512fd00 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb @@ -0,0 +1,122 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + module Models + # + # Information about the webhook destination for an event subscription. + # + class WebHookEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "WebHook" + end + + attr_accessor :endpointType + + # @return [String] The URL that represents the endpoint of the + # destination of an event subscription. + attr_accessor :endpoint_url + + # @return [String] The base URL that represents the endpoint of the + # destination of an event subscription. + attr_accessor :endpoint_base_url + + # @return [Integer] Maximum number of events per batch. + attr_accessor :max_events_per_batch + + # @return [Integer] Preferred batch size in Kilobytes. + attr_accessor :preferred_batch_size_in_kilobytes + + # @return [String] The Azure Active Directory Tenant ID to get the access + # token that will be included as the bearer token in delivery requests. + attr_accessor :azure_active_directory_tenant_id + + # @return [String] The Azure Active Directory Application ID or URI to + # get the access token that will be included as the bearer token in + # delivery requests. + attr_accessor :azure_active_directory_application_id_or_uri + + + # + # Mapper for WebHookEventSubscriptionDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'WebHook', + type: { + name: 'Composite', + class_name: 'WebHookEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + endpoint_url: { + client_side_validation: true, + required: false, + serialized_name: 'properties.endpointUrl', + type: { + name: 'String' + } + }, + endpoint_base_url: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.endpointBaseUrl', + type: { + name: 'String' + } + }, + max_events_per_batch: { + client_side_validation: true, + required: false, + serialized_name: 'properties.maxEventsPerBatch', + type: { + name: 'Number' + } + }, + preferred_batch_size_in_kilobytes: { + client_side_validation: true, + required: false, + serialized_name: 'properties.preferredBatchSizeInKilobytes', + type: { + name: 'Number' + } + }, + azure_active_directory_tenant_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.azureActiveDirectoryTenantId', + type: { + name: 'String' + } + }, + azure_active_directory_application_id_or_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.azureActiveDirectoryApplicationIdOrUri', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/module_definition.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/module_definition.rb new file mode 100644 index 000000000..9f117faab --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/module_definition.rb @@ -0,0 +1,9 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::EventGrid end +module Azure::EventGrid::Mgmt end +module Azure::EventGrid::Mgmt::V2020_06_01 end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/operations.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/operations.rb new file mode 100644 index 000000000..08c99c996 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/operations.rb @@ -0,0 +1,118 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + # + # Azure EventGrid Management Client + # + class Operations + include MsRestAzure + + # + # Creates and initializes a new instance of the Operations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # List available operations. + # + # List the available operations supported by the Microsoft.EventGrid resource + # provider. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationsListResult] operation results. + # + def list(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List available operations. + # + # List the available operations supported by the Microsoft.EventGrid resource + # provider. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # List available operations. + # + # List the available operations supported by the Microsoft.EventGrid resource + # provider. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.EventGrid/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/private_endpoint_connections.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/private_endpoint_connections.rb new file mode 100644 index 000000000..97b8bdb8d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/private_endpoint_connections.rb @@ -0,0 +1,791 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + # + # Azure EventGrid Management Client + # + class PrivateEndpointConnections + include MsRestAzure + + # + # Creates and initializes a new instance of the PrivateEndpointConnections class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # Get a specific private endpoint connection. + # + # Get a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateEndpointConnection] operation results. + # + def get(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + response = get_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a specific private endpoint connection. + # + # Get a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + get_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:custom_headers).value! + end + + # + # Get a specific private endpoint connection. + # + # Get a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'parentType' => parent_type,'parentName' => parent_name,'privateEndpointConnectionName' => private_endpoint_connection_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnection.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update a specific private endpoint connection. + # + # Update a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param private_endpoint_connection [PrivateEndpointConnection] The private + # endpoint connection object to update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateEndpointConnection] operation results. + # + def update(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil) + response = update_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param private_endpoint_connection [PrivateEndpointConnection] The private + # endpoint connection object to update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil) + # Send request + promise = begin_update_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnection.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Delete a specific private endpoint connection. + # + # Delete a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + response = delete_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_resource_as_lazy(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_with_http_info(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + list_by_resource_async(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_async(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'parentType' => parent_type,'parentName' => parent_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnectionListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update a specific private endpoint connection. + # + # Update a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param private_endpoint_connection [PrivateEndpointConnection] The private + # endpoint connection object to update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateEndpointConnection] operation results. + # + def begin_update(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil) + response = begin_update_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update a specific private endpoint connection. + # + # Update a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param private_endpoint_connection [PrivateEndpointConnection] The private + # endpoint connection object to update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil) + begin_update_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers).value! + end + + # + # Update a specific private endpoint connection. + # + # Update a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param private_endpoint_connection [PrivateEndpointConnection] The private + # endpoint connection object to update. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil? + fail ArgumentError, 'private_endpoint_connection is nil' if private_endpoint_connection.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnection.mapper() + request_content = @client.serialize(request_mapper, private_endpoint_connection) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'parentType' => parent_type,'parentName' => parent_name,'privateEndpointConnectionName' => private_endpoint_connection_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnection.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnection.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete a specific private endpoint connection. + # + # Delete a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete a specific private endpoint connection. + # + # Delete a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + begin_delete_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:custom_headers).value! + end + + # + # Delete a specific private endpoint connection. + # + # Delete a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'parentType' => parent_type,'parentName' => parent_name,'privateEndpointConnectionName' => private_endpoint_connection_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateEndpointConnectionListResult] operation results. + # + def list_by_resource_next(next_page_link, custom_headers:nil) + response = list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_next_with_http_info(next_page_link, custom_headers:nil) + list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnectionListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateEndpointConnectionListResult] which provide lazy access to + # pages of the response. + # + def list_by_resource_as_lazy(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_resource_async(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/private_link_resources.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/private_link_resources.rb new file mode 100644 index 000000000..b9c6e6238 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/private_link_resources.rb @@ -0,0 +1,423 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + # + # Azure EventGrid Management Client + # + class PrivateLinkResources + include MsRestAzure + + # + # Creates and initializes a new instance of the PrivateLinkResources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # Get a private link resource. + # + # Get properties of a private link resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_link_resource_name [String] The name of private link resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateLinkResource] operation results. + # + def get(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:nil) + response = get_async(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a private link resource. + # + # Get properties of a private link resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_link_resource_name [String] The name of private link resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:nil) + get_async(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:custom_headers).value! + end + + # + # Get a private link resource. + # + # Get properties of a private link resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_link_resource_name [String] The name of private link resource. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, 'private_link_resource_name is nil' if private_link_resource_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources/{privateLinkResourceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'parentType' => parent_type,'parentName' => parent_name,'privateLinkResourceName' => private_link_resource_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResource.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List private link resources under specific topic or domain. + # + # List all the private link resources under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_resource_as_lazy(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List private link resources under specific topic or domain. + # + # List all the private link resources under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_with_http_info(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + list_by_resource_async(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List private link resources under specific topic or domain. + # + # List all the private link resources under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_async(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'parentType' => parent_type,'parentName' => parent_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResourcesListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List private link resources under specific topic or domain. + # + # List all the private link resources under a topic or domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateLinkResourcesListResult] operation results. + # + def list_by_resource_next(next_page_link, custom_headers:nil) + response = list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List private link resources under specific topic or domain. + # + # List all the private link resources under a topic or domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_next_with_http_info(next_page_link, custom_headers:nil) + list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List private link resources under specific topic or domain. + # + # List all the private link resources under a topic or domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResourcesListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List private link resources under specific topic or domain. + # + # List all the private link resources under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateLinkResourcesListResult] which provide lazy access to pages + # of the response. + # + def list_by_resource_as_lazy(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_resource_async(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/topic_types.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/topic_types.rb new file mode 100644 index 000000000..3a5a8e0fd --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/topic_types.rb @@ -0,0 +1,305 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + # + # Azure EventGrid Management Client + # + class TopicTypes + include MsRestAzure + + # + # Creates and initializes a new instance of the TopicTypes class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # List topic types. + # + # List all registered topic types. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicTypesListResult] operation results. + # + def list(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List topic types. + # + # List all registered topic types. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # List topic types. + # + # List all registered topic types. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.EventGrid/topicTypes' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypesListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a topic type. + # + # Get information about a topic type. + # + # @param topic_type_name [String] Name of the topic type. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicTypeInfo] operation results. + # + def get(topic_type_name, custom_headers:nil) + response = get_async(topic_type_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a topic type. + # + # Get information about a topic type. + # + # @param topic_type_name [String] Name of the topic type. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(topic_type_name, custom_headers:nil) + get_async(topic_type_name, custom_headers:custom_headers).value! + end + + # + # Get a topic type. + # + # Get information about a topic type. + # + # @param topic_type_name [String] Name of the topic type. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(topic_type_name, custom_headers:nil) + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.EventGrid/topicTypes/{topicTypeName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeInfo.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List event types. + # + # List event types for a topic type. + # + # @param topic_type_name [String] Name of the topic type. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventTypesListResult] operation results. + # + def list_event_types(topic_type_name, custom_headers:nil) + response = list_event_types_async(topic_type_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List event types. + # + # List event types for a topic type. + # + # @param topic_type_name [String] Name of the topic type. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_event_types_with_http_info(topic_type_name, custom_headers:nil) + list_event_types_async(topic_type_name, custom_headers:custom_headers).value! + end + + # + # List event types. + # + # List event types for a topic type. + # + # @param topic_type_name [String] Name of the topic type. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_event_types_async(topic_type_name, custom_headers:nil) + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventTypesListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/topics.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/topics.rb new file mode 100644 index 000000000..21cee4a8a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/topics.rb @@ -0,0 +1,1439 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2020_06_01 + # + # Azure EventGrid Management Client + # + class Topics + include MsRestAzure + + # + # Creates and initializes a new instance of the Topics class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # Get a topic. + # + # Get properties of a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Topic] operation results. + # + def get(resource_group_name, topic_name, custom_headers:nil) + response = get_async(resource_group_name, topic_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a topic. + # + # Get properties of a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, topic_name, custom_headers:nil) + get_async(resource_group_name, topic_name, custom_headers:custom_headers).value! + end + + # + # Get a topic. + # + # Get properties of a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, topic_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create a topic. + # + # Asynchronously creates a new topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param topic_info [Topic] Topic information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Topic] operation results. + # + def create_or_update(resource_group_name, topic_name, topic_info, custom_headers:nil) + response = create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param topic_info [Topic] Topic information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Delete a topic. + # + # Delete existing topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, topic_name, custom_headers:nil) + response = delete_async(resource_group_name, topic_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, topic_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, topic_name, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Update a topic. + # + # Asynchronously updates a topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param topic_update_parameters [TopicUpdateParameters] Topic update + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Topic] operation results. + # + def update(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil) + response = update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param topic_update_parameters [TopicUpdateParameters] Topic update + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil) + # Send request + promise = begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # List topics under an Azure subscription. + # + # List all the topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_subscription(filter:nil, top:nil, custom_headers:nil) + first_page = list_by_subscription_as_lazy(filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List topics under an Azure subscription. + # + # List all the topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_with_http_info(filter:nil, top:nil, custom_headers:nil) + list_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List topics under an Azure subscription. + # + # List all the topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_async(filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List topics under a resource group. + # + # List all the topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource_group(resource_group_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List topics under a resource group. + # + # List all the topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, custom_headers:nil) + list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List topics under a resource group. + # + # List all the topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, filter:nil, top:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List keys for a topic. + # + # List the two keys used to publish to a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicSharedAccessKeys] operation results. + # + def list_shared_access_keys(resource_group_name, topic_name, custom_headers:nil) + response = list_shared_access_keys_async(resource_group_name, topic_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List keys for a topic. + # + # List the two keys used to publish to a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_shared_access_keys_with_http_info(resource_group_name, topic_name, custom_headers:nil) + list_shared_access_keys_async(resource_group_name, topic_name, custom_headers:custom_headers).value! + end + + # + # List keys for a topic. + # + # List the two keys used to publish to a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_shared_access_keys_async(resource_group_name, topic_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicSharedAccessKeys.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Regenerate key for a topic. + # + # Regenerate a shared access key for a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param regenerate_key_request [TopicRegenerateKeyRequest] Request body to + # regenerate key. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicSharedAccessKeys] operation results. + # + def regenerate_key(resource_group_name, topic_name, regenerate_key_request, custom_headers:nil) + response = regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Regenerate key for a topic. + # + # Regenerate a shared access key for a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param regenerate_key_request [TopicRegenerateKeyRequest] Request body to + # regenerate key. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def regenerate_key_with_http_info(resource_group_name, topic_name, regenerate_key_request, custom_headers:nil) + regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers:custom_headers).value! + end + + # + # Regenerate key for a topic. + # + # Regenerate a shared access key for a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param regenerate_key_request [TopicRegenerateKeyRequest] Request body to + # regenerate key. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, 'regenerate_key_request is nil' if regenerate_key_request.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicRegenerateKeyRequest.mapper() + request_content = @client.serialize(request_mapper, regenerate_key_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicSharedAccessKeys.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List topic event types. + # + # List event types for a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic. + # @param resource_type_name [String] Name of the topic type. + # @param resource_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventTypesListResult] operation results. + # + def list_event_types(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers:nil) + response = list_event_types_async(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List topic event types. + # + # List event types for a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic. + # @param resource_type_name [String] Name of the topic type. + # @param resource_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_event_types_with_http_info(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers:nil) + list_event_types_async(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers:custom_headers).value! + end + + # + # List topic event types. + # + # List event types for a topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic. + # @param resource_type_name [String] Name of the topic type. + # @param resource_name [String] Name of the topic. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_event_types_async(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'provider_namespace is nil' if provider_namespace.nil? + fail ArgumentError, 'resource_type_name is nil' if resource_type_name.nil? + fail ArgumentError, 'resource_name is nil' if resource_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerNamespace' => provider_namespace,'resourceTypeName' => resource_type_name,'resourceName' => resource_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventTypesListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create a topic. + # + # Asynchronously creates a new topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param topic_info [Topic] Topic information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Topic] operation results. + # + def begin_create_or_update(resource_group_name, topic_name, topic_info, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create a topic. + # + # Asynchronously creates a new topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param topic_info [Topic] Topic information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, topic_name, topic_info, custom_headers:nil) + begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers).value! + end + + # + # Create a topic. + # + # Asynchronously creates a new topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param topic_info [Topic] Topic information. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, 'topic_info is nil' if topic_info.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic.mapper() + request_content = @client.serialize(request_mapper, topic_info) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete a topic. + # + # Delete existing topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, topic_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, topic_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete a topic. + # + # Delete existing topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, topic_name, custom_headers:nil) + begin_delete_async(resource_group_name, topic_name, custom_headers:custom_headers).value! + end + + # + # Delete a topic. + # + # Delete existing topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, topic_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update a topic. + # + # Asynchronously updates a topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param topic_update_parameters [TopicUpdateParameters] Topic update + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Topic] operation results. + # + def begin_update(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil) + response = begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update a topic. + # + # Asynchronously updates a topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param topic_update_parameters [TopicUpdateParameters] Topic update + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil) + begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:custom_headers).value! + end + + # + # Update a topic. + # + # Asynchronously updates a topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic. + # @param topic_update_parameters [TopicUpdateParameters] Topic update + # information. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, 'topic_update_parameters is nil' if topic_update_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, topic_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List topics under an Azure subscription. + # + # List all the topics under an Azure subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicsListResult] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers:nil) + response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List topics under an Azure subscription. + # + # List all the topics under an Azure subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil) + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List topics under an Azure subscription. + # + # List all the topics under an Azure subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List topics under a resource group. + # + # List all the topics under a resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicsListResult] operation results. + # + def list_by_resource_group_next(next_page_link, custom_headers:nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List topics under a resource group. + # + # List all the topics under a resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil) + list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List topics under a resource group. + # + # List all the topics under a resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List topics under an Azure subscription. + # + # List all the topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicsListResult] which provide lazy access to pages of the + # response. + # + def list_by_subscription_as_lazy(filter:nil, top:nil, custom_headers:nil) + response = list_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List topics under a resource group. + # + # List all the topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicsListResult] which provide lazy access to pages of the + # response. + # + def list_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/azure_mgmt_event_grid.rb b/management/azure_mgmt_event_grid/lib/azure_mgmt_event_grid.rb index bde657900..d1dbe89f0 100644 --- a/management/azure_mgmt_event_grid/lib/azure_mgmt_event_grid.rb +++ b/management/azure_mgmt_event_grid/lib/azure_mgmt_event_grid.rb @@ -8,6 +8,7 @@ require '2018-09-15-preview/generated/azure_mgmt_event_grid' require '2017-09-15-preview/generated/azure_mgmt_event_grid' require '2019-01-01/generated/azure_mgmt_event_grid' require '2017-06-15-preview/generated/azure_mgmt_event_grid' +require '2020-06-01/generated/azure_mgmt_event_grid' require '2018-01-01/generated/azure_mgmt_event_grid' require '2019-06-01/generated/azure_mgmt_event_grid' require '2019-02-01-preview/generated/azure_mgmt_event_grid' diff --git a/management/azure_mgmt_event_grid/lib/profiles/latest/modules/eventgrid_profile_module.rb b/management/azure_mgmt_event_grid/lib/profiles/latest/modules/eventgrid_profile_module.rb index 7deec004a..c7964d62e 100644 --- a/management/azure_mgmt_event_grid/lib/profiles/latest/modules/eventgrid_profile_module.rb +++ b/management/azure_mgmt_event_grid/lib/profiles/latest/modules/eventgrid_profile_module.rb @@ -6,144 +6,96 @@ require 'azure_mgmt_event_grid' module Azure::EventGrid::Profiles::Latest module Mgmt - Domains = Azure::EventGrid::Mgmt::V2020_04_01_preview::Domains - DomainTopics = Azure::EventGrid::Mgmt::V2020_04_01_preview::DomainTopics - EventChannels = Azure::EventGrid::Mgmt::V2020_04_01_preview::EventChannels - EventSubscriptions = Azure::EventGrid::Mgmt::V2020_04_01_preview::EventSubscriptions - SystemTopicEventSubscriptions = Azure::EventGrid::Mgmt::V2020_04_01_preview::SystemTopicEventSubscriptions - PartnerTopicEventSubscriptions = Azure::EventGrid::Mgmt::V2020_04_01_preview::PartnerTopicEventSubscriptions - Operations = Azure::EventGrid::Mgmt::V2020_04_01_preview::Operations - PartnerNamespaces = Azure::EventGrid::Mgmt::V2020_04_01_preview::PartnerNamespaces - PartnerRegistrations = Azure::EventGrid::Mgmt::V2020_04_01_preview::PartnerRegistrations - PartnerTopics = Azure::EventGrid::Mgmt::V2020_04_01_preview::PartnerTopics - PrivateEndpointConnections = Azure::EventGrid::Mgmt::V2020_04_01_preview::PrivateEndpointConnections - PrivateLinkResources = Azure::EventGrid::Mgmt::V2020_04_01_preview::PrivateLinkResources - SystemTopics = Azure::EventGrid::Mgmt::V2020_04_01_preview::SystemTopics - Topics = Azure::EventGrid::Mgmt::V2020_04_01_preview::Topics - ExtensionTopics = Azure::EventGrid::Mgmt::V2020_04_01_preview::ExtensionTopics - TopicTypes = Azure::EventGrid::Mgmt::V2020_04_01_preview::TopicTypes + Domains = Azure::EventGrid::Mgmt::V2020_06_01::Domains + DomainTopics = Azure::EventGrid::Mgmt::V2020_06_01::DomainTopics + EventSubscriptions = Azure::EventGrid::Mgmt::V2020_06_01::EventSubscriptions + Operations = Azure::EventGrid::Mgmt::V2020_06_01::Operations + Topics = Azure::EventGrid::Mgmt::V2020_06_01::Topics + PrivateEndpointConnections = Azure::EventGrid::Mgmt::V2020_06_01::PrivateEndpointConnections + PrivateLinkResources = Azure::EventGrid::Mgmt::V2020_06_01::PrivateLinkResources + TopicTypes = Azure::EventGrid::Mgmt::V2020_06_01::TopicTypes module Models - PartnerTopicTypesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicTypesListResult - PrivateEndpoint = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpoint - PartnerTopicsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicsListResult - PartnerNamespacesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespacesListResult - PartnerNamespaceUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceUpdateParameters - InboundIpRule = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InboundIpRule - PrivateLinkResource = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateLinkResource - UserIdentityProperties = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::UserIdentityProperties - OperationsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::OperationsListResult - Resource = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Resource - Operation = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Operation - JsonFieldWithDefault = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonFieldWithDefault - OperationInfo = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::OperationInfo - PartnerRegistrationEventTypesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationEventTypesListResult - EventSubscriptionsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionsListResult - DomainUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainUpdateParameters - ConnectionState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ConnectionState - DomainSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainSharedAccessKeys - EventSubscriptionFullUrl = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionFullUrl - PartnerRegistrationsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationsListResult - EventChannelsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelsListResult - EventChannelSource = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelSource - EventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionDestination - AdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::AdvancedFilter - EventSubscriptionIdentity = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionIdentity - PartnerRegistrationUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationUpdateParameters - DeliveryWithResourceIdentity = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeliveryWithResourceIdentity - PartnerNamespaceRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceRegenerateKeyRequest - EventSubscriptionFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionFilter - InputSchemaMapping = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InputSchemaMapping - RetryPolicy = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::RetryPolicy - IdentityInfo = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IdentityInfo - DeadLetterDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeadLetterDestination - PartnerTopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicUpdateParameters - DeadLetterWithResourceIdentity = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeadLetterWithResourceIdentity - DomainsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainsListResult - DomainTopicsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopicsListResult - TopicTypesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypesListResult - EventChannelFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelFilter - TopicRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicRegenerateKeyRequest - PartnerNamespaceSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceSharedAccessKeys - TopicSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicSharedAccessKeys - JsonField = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonField - TopicsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicsListResult - DomainRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainRegenerateKeyRequest - TopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicUpdateParameters - PrivateEndpointConnectionListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpointConnectionListResult - SystemTopicsListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopicsListResult - EventTypesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventTypesListResult - SystemTopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopicUpdateParameters - ResourceSku = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceSku - PrivateLinkResourcesListResult = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateLinkResourcesListResult - EventChannelDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelDestination - EventSubscriptionUpdateParameters = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionUpdateParameters - PrivateEndpointConnection = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpointConnection - JsonInputSchemaMapping = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonInputSchemaMapping - TrackedResource = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TrackedResource - Domain = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Domain - DomainTopic = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopic - NumberInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberInAdvancedFilter - NumberNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberNotInAdvancedFilter - NumberLessThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberLessThanAdvancedFilter - NumberGreaterThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberGreaterThanAdvancedFilter - NumberLessThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberLessThanOrEqualsAdvancedFilter - NumberGreaterThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberGreaterThanOrEqualsAdvancedFilter - BoolEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::BoolEqualsAdvancedFilter - StringInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringInAdvancedFilter - StringNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringNotInAdvancedFilter - StringBeginsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringBeginsWithAdvancedFilter - StringEndsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringEndsWithAdvancedFilter - StringContainsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringContainsAdvancedFilter - EventChannel = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannel - StorageBlobDeadLetterDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StorageBlobDeadLetterDestination - WebHookEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::WebHookEventSubscriptionDestination - EventHubEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventHubEventSubscriptionDestination - StorageQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StorageQueueEventSubscriptionDestination - HybridConnectionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::HybridConnectionEventSubscriptionDestination - ServiceBusQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ServiceBusQueueEventSubscriptionDestination - ServiceBusTopicEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ServiceBusTopicEventSubscriptionDestination - AzureFunctionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::AzureFunctionEventSubscriptionDestination - EventSubscription = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscription - PartnerNamespace = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespace - PartnerRegistration = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistration - EventType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventType - PartnerTopic = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopic - PartnerTopicType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicType - SystemTopic = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopic - Topic = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Topic - ExtensionTopic = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ExtensionTopic - TopicTypeInfo = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypeInfo - PersistedConnectionStatus = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PersistedConnectionStatus - ResourceProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceProvisioningState - DomainProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainProvisioningState - InputSchema = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InputSchema - PublicNetworkAccess = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PublicNetworkAccess - IpActionType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IpActionType - Sku = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Sku - IdentityType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IdentityType - DomainTopicProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopicProvisioningState - EventChannelProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelProvisioningState - PartnerTopicReadinessState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicReadinessState - EventSubscriptionProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionProvisioningState - EventSubscriptionIdentityType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionIdentityType - EventDeliverySchema = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventDeliverySchema - PartnerNamespaceProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceProvisioningState - PartnerRegistrationProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationProvisioningState - PartnerRegistrationVisibilityState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationVisibilityState - PartnerTopicProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicProvisioningState - PartnerTopicActivationState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicActivationState - PartnerTopicTypeAuthorizationState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicTypeAuthorizationState - TopicProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicProvisioningState - ResourceRegionType = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceRegionType - TopicTypeProvisioningState = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypeProvisioningState + AdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::AdvancedFilter + EventSubscriptionFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFilter + ConnectionState = Azure::EventGrid::Mgmt::V2020_06_01::Models::ConnectionState + RetryPolicy = Azure::EventGrid::Mgmt::V2020_06_01::Models::RetryPolicy + InputSchemaMapping = Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchemaMapping + DeadLetterDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::DeadLetterDestination + Resource = Azure::EventGrid::Mgmt::V2020_06_01::Models::Resource + EventSubscriptionsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult + JsonFieldWithDefault = Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonFieldWithDefault + EventSubscriptionFullUrl = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFullUrl + JsonField = Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonField + TopicSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicSharedAccessKeys + DomainUpdateParameters = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainUpdateParameters + TopicsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicsListResult + DomainSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainSharedAccessKeys + EventSubscriptionUpdateParameters = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionUpdateParameters + TopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicUpdateParameters + OperationInfo = Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationInfo + EventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionDestination + Operation = Azure::EventGrid::Mgmt::V2020_06_01::Models::Operation + TopicRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicRegenerateKeyRequest + InboundIpRule = Azure::EventGrid::Mgmt::V2020_06_01::Models::InboundIpRule + OperationsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationsListResult + DomainsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainsListResult + PrivateEndpointConnectionListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnectionListResult + DomainTopicsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicsListResult + PrivateLinkResource = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResource + PrivateLinkResourcesListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResourcesListResult + PrivateEndpoint = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpoint + TopicTypesListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypesListResult + DomainRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainRegenerateKeyRequest + EventTypesListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventTypesListResult + PrivateEndpointConnection = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnection + JsonInputSchemaMapping = Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonInputSchemaMapping + TrackedResource = Azure::EventGrid::Mgmt::V2020_06_01::Models::TrackedResource + Domain = Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain + DomainTopic = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopic + NumberInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberInAdvancedFilter + StorageBlobDeadLetterDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageBlobDeadLetterDestination + NumberNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberNotInAdvancedFilter + NumberLessThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanAdvancedFilter + NumberGreaterThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanAdvancedFilter + NumberLessThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanOrEqualsAdvancedFilter + NumberGreaterThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanOrEqualsAdvancedFilter + BoolEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::BoolEqualsAdvancedFilter + StringInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringInAdvancedFilter + StringNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringNotInAdvancedFilter + StringBeginsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringBeginsWithAdvancedFilter + StringEndsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringEndsWithAdvancedFilter + StringContainsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringContainsAdvancedFilter + WebHookEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::WebHookEventSubscriptionDestination + EventHubEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventHubEventSubscriptionDestination + StorageQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageQueueEventSubscriptionDestination + HybridConnectionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::HybridConnectionEventSubscriptionDestination + ServiceBusQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusQueueEventSubscriptionDestination + ServiceBusTopicEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusTopicEventSubscriptionDestination + AzureFunctionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::AzureFunctionEventSubscriptionDestination + EventSubscription = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription + Topic = Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic + EventType = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventType + TopicTypeInfo = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeInfo + PersistedConnectionStatus = Azure::EventGrid::Mgmt::V2020_06_01::Models::PersistedConnectionStatus + ResourceProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceProvisioningState + DomainProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainProvisioningState + InputSchema = Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchema + PublicNetworkAccess = Azure::EventGrid::Mgmt::V2020_06_01::Models::PublicNetworkAccess + IpActionType = Azure::EventGrid::Mgmt::V2020_06_01::Models::IpActionType + DomainTopicProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicProvisioningState + EventSubscriptionProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionProvisioningState + EventDeliverySchema = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventDeliverySchema + TopicProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicProvisioningState + ResourceRegionType = Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceRegionType + TopicTypeProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeProvisioningState end # # EventGridManagementClass # class EventGridManagementClass - attr_reader :domains, :domain_topics, :event_channels, :event_subscriptions, :system_topic_event_subscriptions, :partner_topic_event_subscriptions, :operations, :partner_namespaces, :partner_registrations, :partner_topics, :private_endpoint_connections, :private_link_resources, :system_topics, :topics, :extension_topics, :topic_types, :configurable, :base_url, :options, :model_classes + attr_reader :domains, :domain_topics, :event_subscriptions, :operations, :topics, :private_endpoint_connections, :private_link_resources, :topic_types, :configurable, :base_url, :options, :model_classes def initialize(options = {}) if options.is_a?(Hash) && options.length == 0 @@ -158,26 +110,18 @@ module Azure::EventGrid::Profiles::Latest @base_url = options[:base_url].nil? ? nil:options[:base_url] @options = options[:options].nil? ? nil:options[:options] - @client_0 = Azure::EventGrid::Mgmt::V2020_04_01_preview::EventGridManagementClient.new(configurable.credentials, base_url, options) + @client_0 = Azure::EventGrid::Mgmt::V2020_06_01::EventGridManagementClient.new(configurable.credentials, base_url, options) if(@client_0.respond_to?(:subscription_id)) @client_0.subscription_id = configurable.subscription_id end add_telemetry(@client_0) @domains = @client_0.domains @domain_topics = @client_0.domain_topics - @event_channels = @client_0.event_channels @event_subscriptions = @client_0.event_subscriptions - @system_topic_event_subscriptions = @client_0.system_topic_event_subscriptions - @partner_topic_event_subscriptions = @client_0.partner_topic_event_subscriptions @operations = @client_0.operations - @partner_namespaces = @client_0.partner_namespaces - @partner_registrations = @client_0.partner_registrations - @partner_topics = @client_0.partner_topics + @topics = @client_0.topics @private_endpoint_connections = @client_0.private_endpoint_connections @private_link_resources = @client_0.private_link_resources - @system_topics = @client_0.system_topics - @topics = @client_0.topics - @extension_topics = @client_0.extension_topics @topic_types = @client_0.topic_types @model_classes = ModelClasses.new @@ -199,344 +143,224 @@ module Azure::EventGrid::Profiles::Latest end class ModelClasses - def partner_topic_types_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicTypesListResult - end - def private_endpoint - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpoint - end - def partner_topics_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicsListResult - end - def partner_namespaces_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespacesListResult - end - def partner_namespace_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceUpdateParameters - end - def inbound_ip_rule - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InboundIpRule - end - def private_link_resource - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateLinkResource - end - def user_identity_properties - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::UserIdentityProperties - end - def operations_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::OperationsListResult - end - def resource - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Resource - end - def operation - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Operation - end - def json_field_with_default - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonFieldWithDefault - end - def operation_info - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::OperationInfo - end - def partner_registration_event_types_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationEventTypesListResult - end - def event_subscriptions_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionsListResult - end - def domain_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainUpdateParameters - end - def connection_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ConnectionState - end - def domain_shared_access_keys - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainSharedAccessKeys - end - def event_subscription_full_url - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionFullUrl - end - def partner_registrations_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationsListResult - end - def event_channels_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelsListResult - end - def event_channel_source - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelSource - end - def event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionDestination - end def advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::AdvancedFilter - end - def event_subscription_identity - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionIdentity - end - def partner_registration_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationUpdateParameters - end - def delivery_with_resource_identity - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeliveryWithResourceIdentity - end - def partner_namespace_regenerate_key_request - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceRegenerateKeyRequest + Azure::EventGrid::Mgmt::V2020_06_01::Models::AdvancedFilter end def event_subscription_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionFilter + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFilter end - def input_schema_mapping - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InputSchemaMapping + def connection_state + Azure::EventGrid::Mgmt::V2020_06_01::Models::ConnectionState end def retry_policy - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::RetryPolicy + Azure::EventGrid::Mgmt::V2020_06_01::Models::RetryPolicy end - def identity_info - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IdentityInfo + def input_schema_mapping + Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchemaMapping end def dead_letter_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeadLetterDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::DeadLetterDestination end - def partner_topic_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicUpdateParameters + def resource + Azure::EventGrid::Mgmt::V2020_06_01::Models::Resource end - def dead_letter_with_resource_identity - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DeadLetterWithResourceIdentity + def event_subscriptions_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult end - def domains_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainsListResult + def json_field_with_default + Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonFieldWithDefault end - def domain_topics_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopicsListResult - end - def topic_types_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypesListResult - end - def event_channel_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelFilter - end - def topic_regenerate_key_request - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicRegenerateKeyRequest - end - def partner_namespace_shared_access_keys - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceSharedAccessKeys - end - def topic_shared_access_keys - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicSharedAccessKeys + def event_subscription_full_url + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFullUrl end def json_field - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonField + Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonField + end + def topic_shared_access_keys + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicSharedAccessKeys + end + def domain_update_parameters + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainUpdateParameters end def topics_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicsListResult + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicsListResult end - def domain_regenerate_key_request - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainRegenerateKeyRequest - end - def topic_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicUpdateParameters - end - def private_endpoint_connection_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpointConnectionListResult - end - def system_topics_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopicsListResult - end - def event_types_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventTypesListResult - end - def system_topic_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopicUpdateParameters - end - def resource_sku - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceSku - end - def private_link_resources_list_result - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateLinkResourcesListResult - end - def event_channel_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelDestination + def domain_shared_access_keys + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainSharedAccessKeys end def event_subscription_update_parameters - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionUpdateParameters + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionUpdateParameters + end + def topic_update_parameters + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicUpdateParameters + end + def operation_info + Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationInfo + end + def event_subscription_destination + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionDestination + end + def operation + Azure::EventGrid::Mgmt::V2020_06_01::Models::Operation + end + def topic_regenerate_key_request + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicRegenerateKeyRequest + end + def inbound_ip_rule + Azure::EventGrid::Mgmt::V2020_06_01::Models::InboundIpRule + end + def operations_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationsListResult + end + def domains_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainsListResult + end + def private_endpoint_connection_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnectionListResult + end + def domain_topics_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicsListResult + end + def private_link_resource + Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResource + end + def private_link_resources_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResourcesListResult + end + def private_endpoint + Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpoint + end + def topic_types_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypesListResult + end + def domain_regenerate_key_request + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainRegenerateKeyRequest + end + def event_types_list_result + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventTypesListResult end def private_endpoint_connection - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PrivateEndpointConnection + Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnection end def json_input_schema_mapping - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::JsonInputSchemaMapping + Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonInputSchemaMapping end def tracked_resource - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TrackedResource + Azure::EventGrid::Mgmt::V2020_06_01::Models::TrackedResource end def domain - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Domain + Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain end def domain_topic - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopic + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopic end def number_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberInAdvancedFilter - end - def number_not_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberNotInAdvancedFilter - end - def number_less_than_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberLessThanAdvancedFilter - end - def number_greater_than_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberGreaterThanAdvancedFilter - end - def number_less_than_or_equals_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberLessThanOrEqualsAdvancedFilter - end - def number_greater_than_or_equals_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::NumberGreaterThanOrEqualsAdvancedFilter - end - def bool_equals_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::BoolEqualsAdvancedFilter - end - def string_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringInAdvancedFilter - end - def string_not_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringNotInAdvancedFilter - end - def string_begins_with_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringBeginsWithAdvancedFilter - end - def string_ends_with_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringEndsWithAdvancedFilter - end - def string_contains_advanced_filter - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StringContainsAdvancedFilter - end - def event_channel - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannel + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberInAdvancedFilter end def storage_blob_dead_letter_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StorageBlobDeadLetterDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageBlobDeadLetterDestination + end + def number_not_in_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberNotInAdvancedFilter + end + def number_less_than_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanAdvancedFilter + end + def number_greater_than_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanAdvancedFilter + end + def number_less_than_or_equals_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanOrEqualsAdvancedFilter + end + def number_greater_than_or_equals_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanOrEqualsAdvancedFilter + end + def bool_equals_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::BoolEqualsAdvancedFilter + end + def string_in_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::StringInAdvancedFilter + end + def string_not_in_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::StringNotInAdvancedFilter + end + def string_begins_with_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::StringBeginsWithAdvancedFilter + end + def string_ends_with_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::StringEndsWithAdvancedFilter + end + def string_contains_advanced_filter + Azure::EventGrid::Mgmt::V2020_06_01::Models::StringContainsAdvancedFilter end def web_hook_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::WebHookEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::WebHookEventSubscriptionDestination end def event_hub_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventHubEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventHubEventSubscriptionDestination end def storage_queue_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::StorageQueueEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageQueueEventSubscriptionDestination end def hybrid_connection_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::HybridConnectionEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::HybridConnectionEventSubscriptionDestination end def service_bus_queue_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ServiceBusQueueEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusQueueEventSubscriptionDestination end def service_bus_topic_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ServiceBusTopicEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusTopicEventSubscriptionDestination end def azure_function_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::AzureFunctionEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_06_01::Models::AzureFunctionEventSubscriptionDestination end def event_subscription - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscription - end - def partner_namespace - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespace - end - def partner_registration - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistration - end - def event_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventType - end - def partner_topic - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopic - end - def partner_topic_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicType - end - def system_topic - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::SystemTopic + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription end def topic - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Topic + Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic end - def extension_topic - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ExtensionTopic + def event_type + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventType end def topic_type_info - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypeInfo + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeInfo end def persisted_connection_status - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PersistedConnectionStatus + Azure::EventGrid::Mgmt::V2020_06_01::Models::PersistedConnectionStatus end def resource_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceProvisioningState + Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceProvisioningState end def domain_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainProvisioningState + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainProvisioningState end def input_schema - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::InputSchema + Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchema end def public_network_access - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PublicNetworkAccess + Azure::EventGrid::Mgmt::V2020_06_01::Models::PublicNetworkAccess end def ip_action_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IpActionType - end - def sku - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Sku - end - def identity_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::IdentityType + Azure::EventGrid::Mgmt::V2020_06_01::Models::IpActionType end def domain_topic_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::DomainTopicProvisioningState - end - def event_channel_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventChannelProvisioningState - end - def partner_topic_readiness_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicReadinessState + Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicProvisioningState end def event_subscription_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionProvisioningState - end - def event_subscription_identity_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventSubscriptionIdentityType + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionProvisioningState end def event_delivery_schema - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventDeliverySchema - end - def partner_namespace_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerNamespaceProvisioningState - end - def partner_registration_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationProvisioningState - end - def partner_registration_visibility_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerRegistrationVisibilityState - end - def partner_topic_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicProvisioningState - end - def partner_topic_activation_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicActivationState - end - def partner_topic_type_authorization_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::PartnerTopicTypeAuthorizationState + Azure::EventGrid::Mgmt::V2020_06_01::Models::EventDeliverySchema end def topic_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicProvisioningState + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicProvisioningState end def resource_region_type - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::ResourceRegionType + Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceRegionType end def topic_type_provisioning_state - Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicTypeProvisioningState + Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeProvisioningState end end end diff --git a/management/azure_mgmt_event_grid/lib/version.rb b/management/azure_mgmt_event_grid/lib/version.rb index 9e1663ec7..66f07e0b0 100644 --- a/management/azure_mgmt_event_grid/lib/version.rb +++ b/management/azure_mgmt_event_grid/lib/version.rb @@ -3,5 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. module Azure::EventGrid::Mgmt - VERSION = '0.20.1' + VERSION = '0.20.2' end diff --git a/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb b/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb index 90d448bf5..4c9178d42 100644 --- a/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb +++ b/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb @@ -154,7 +154,7 @@ module Azure::Hdinsight::Mgmt::V2015_03_01_preview # def add_telemetry sdk_information = 'azure_mgmt_hdinsight' - sdk_information = "#{sdk_information}/0.17.8" + sdk_information = "#{sdk_information}/0.18.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight.rb b/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight.rb index 647a96fad..ed5c49a03 100644 --- a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight.rb +++ b/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight.rb @@ -33,81 +33,80 @@ module Azure::Hdinsight::Mgmt::V2018_06_01_preview module Models autoload :ClusterDiskEncryptionParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_disk_encryption_parameters.rb' - autoload :UpdateGatewaySettingsParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/update_gateway_settings_parameters.rb' - autoload :ClientGroupInfo, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/client_group_info.rb' - autoload :GatewaySettings, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/gateway_settings.rb' - autoload :SecurityProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/security_profile.rb' - autoload :OperationResource, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_resource.rb' - autoload :AutoscaleSchedule, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/autoscale_schedule.rb' - autoload :Resource, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/resource.rb' - autoload :AutoscaleRecurrence, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/autoscale_recurrence.rb' - autoload :AutoscaleCapacity, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/autoscale_capacity.rb' - autoload :HardwareProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/hardware_profile.rb' - autoload :Autoscale, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/autoscale.rb' - autoload :DataDisksGroups, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/data_disks_groups.rb' - autoload :HostInfoListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/host_info_list_result.rb' - autoload :SshProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ssh_profile.rb' - autoload :HostInfo, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/host_info.rb' - autoload :OsProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/os_profile.rb' - autoload :ErrorResponse, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/error_response.rb' - autoload :Role, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/role.rb' - autoload :ApplicationGetHttpsEndpoint, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_get_https_endpoint.rb' - autoload :StorageAccount, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb' - autoload :ApplicationGetEndpoint, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_get_endpoint.rb' - autoload :DiskEncryptionProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/disk_encryption_properties.rb' - autoload :ApplicationProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_properties.rb' - autoload :ClusterIdentityUserAssignedIdentitiesValue, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity_user_assigned_identities_value.rb' - autoload :OperationListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_list_result.rb' - autoload :ClusterCreateParametersExtended, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_parameters_extended.rb' - autoload :ApplicationListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_list_result.rb' - autoload :QuotaInfo, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/quota_info.rb' - autoload :VersionSpec, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/version_spec.rb' - autoload :ConnectivityEndpoint, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/connectivity_endpoint.rb' - autoload :VersionsCapability, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/versions_capability.rb' - autoload :RegionsCapability, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/regions_capability.rb' - autoload :ExecuteScriptActionParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/execute_script_action_parameters.rb' - autoload :VmSizesCapability, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/vm_sizes_capability.rb' - autoload :ScriptActionExecutionSummary, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_summary.rb' - autoload :VmSizeCompatibilityFilter, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/vm_size_compatibility_filter.rb' - autoload :ClusterListRuntimeScriptActionDetailResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_runtime_script_action_detail_result.rb' - autoload :RegionalQuotaCapability, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/regional_quota_capability.rb' - autoload :ClusterResizeParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_resize_parameters.rb' - autoload :QuotaCapability, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/quota_capability.rb' - autoload :KafkaRestProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/kafka_rest_properties.rb' - autoload :CapabilitiesResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/capabilities_result.rb' - autoload :VirtualNetworkProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/virtual_network_profile.rb' - autoload :LocalizedName, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/localized_name.rb' - autoload :LinuxOperatingSystemProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/linux_operating_system_profile.rb' - autoload :Usage, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/usage.rb' - autoload :ComputeProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/compute_profile.rb' - autoload :UsagesListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/usages_list_result.rb' - autoload :ClusterCreateProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_properties.rb' - autoload :VmSizeCompatibilityFilterV2, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/vm_size_compatibility_filter_v2.rb' - autoload :ClusterPatchParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_patch_parameters.rb' - autoload :BillingMeters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/billing_meters.rb' - autoload :ClusterGetProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_get_properties.rb' - autoload :DiskBillingMeters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/disk_billing_meters.rb' - autoload :ClusterListPersistedScriptActionsResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_persisted_script_actions_result.rb' - autoload :BillingResources, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/billing_resources.rb' - autoload :ClusterListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_result.rb' - autoload :BillingResponseListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/billing_response_list_result.rb' - autoload :AutoscaleTimeAndCapacity, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/autoscale_time_and_capacity.rb' - autoload :ClusterConfigurations, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_configurations.rb' - autoload :ScriptAction, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action.rb' - autoload :Extension, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/extension.rb' - autoload :ClusterIdentity, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity.rb' - autoload :ClusterMonitoringResponse, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_response.rb' - autoload :RuntimeScriptAction, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action.rb' - autoload :ClusterMonitoringRequest, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_request.rb' autoload :ClusterDefinition, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_definition.rb' - autoload :ScriptActionExecutionHistoryList, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_history_list.rb' - autoload :StorageProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_profile.rb' - autoload :ScriptActionPersistedGetResponseSpec, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_persisted_get_response_spec.rb' - autoload :Operation, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation.rb' + autoload :UpdateGatewaySettingsParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/update_gateway_settings_parameters.rb' + autoload :KafkaRestProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/kafka_rest_properties.rb' + autoload :GatewaySettings, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/gateway_settings.rb' + autoload :AutoscaleTimeAndCapacity, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/autoscale_time_and_capacity.rb' + autoload :OperationResource, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_resource.rb' + autoload :AutoscaleCapacity, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/autoscale_capacity.rb' + autoload :Resource, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/resource.rb' + autoload :Autoscale, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/autoscale.rb' + autoload :AutoscaleRecurrence, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/autoscale_recurrence.rb' + autoload :VirtualNetworkProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/virtual_network_profile.rb' + autoload :HardwareProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/hardware_profile.rb' autoload :SshPublicKey, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ssh_public_key.rb' - autoload :ScriptActionsList, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_actions_list.rb' + autoload :HostInfo, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/host_info.rb' + autoload :LinuxOperatingSystemProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/linux_operating_system_profile.rb' + autoload :OperationListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_list_result.rb' + autoload :ScriptAction, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action.rb' + autoload :ErrorResponse, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/error_response.rb' + autoload :ComputeProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/compute_profile.rb' + autoload :ApplicationGetHttpsEndpoint, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_get_https_endpoint.rb' + autoload :StorageProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_profile.rb' + autoload :ApplicationGetEndpoint, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_get_endpoint.rb' + autoload :ClusterCreateProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_properties.rb' + autoload :ApplicationProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_properties.rb' + autoload :ClusterIdentity, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity.rb' + autoload :Operation, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation.rb' + autoload :ClusterPatchParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_patch_parameters.rb' + autoload :ApplicationListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_list_result.rb' autoload :Errors, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/errors.rb' + autoload :VersionSpec, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/version_spec.rb' + autoload :ClusterGetProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_get_properties.rb' + autoload :VersionsCapability, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/versions_capability.rb' + autoload :RuntimeScriptAction, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action.rb' + autoload :RegionsCapability, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/regions_capability.rb' + autoload :ClusterListPersistedScriptActionsResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_persisted_script_actions_result.rb' + autoload :VmSizesCapability, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/vm_sizes_capability.rb' autoload :OperationDisplay, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_display.rb' + autoload :ClusterListRuntimeScriptActionDetailResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_runtime_script_action_detail_result.rb' + autoload :VmSizeCompatibilityFilter, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/vm_size_compatibility_filter.rb' + autoload :ClusterResizeParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_resize_parameters.rb' + autoload :RegionalQuotaCapability, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/regional_quota_capability.rb' + autoload :SecurityProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/security_profile.rb' + autoload :QuotaCapability, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/quota_capability.rb' + autoload :DataDisksGroups, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/data_disks_groups.rb' + autoload :CapabilitiesResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/capabilities_result.rb' + autoload :OsProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/os_profile.rb' + autoload :LocalizedName, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/localized_name.rb' + autoload :StorageAccount, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb' + autoload :Usage, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/usage.rb' + autoload :ClusterIdentityUserAssignedIdentitiesValue, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity_user_assigned_identities_value.rb' + autoload :UsagesListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/usages_list_result.rb' + autoload :QuotaInfo, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/quota_info.rb' + autoload :VmSizeCompatibilityFilterV2, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/vm_size_compatibility_filter_v2.rb' + autoload :BillingMeters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/billing_meters.rb' + autoload :ScriptActionExecutionSummary, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_summary.rb' + autoload :DiskBillingMeters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/disk_billing_meters.rb' + autoload :ClientGroupInfo, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/client_group_info.rb' + autoload :BillingResources, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/billing_resources.rb' + autoload :SshProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ssh_profile.rb' + autoload :BillingResponseListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/billing_response_list_result.rb' + autoload :DiskEncryptionProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/disk_encryption_properties.rb' + autoload :ClusterConfigurations, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_configurations.rb' + autoload :ConnectivityEndpoint, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/connectivity_endpoint.rb' + autoload :Extension, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/extension.rb' + autoload :ClusterListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_result.rb' + autoload :ClusterMonitoringResponse, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_response.rb' + autoload :Role, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/role.rb' + autoload :ClusterMonitoringRequest, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_request.rb' + autoload :ExecuteScriptActionParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/execute_script_action_parameters.rb' + autoload :ScriptActionExecutionHistoryList, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_history_list.rb' + autoload :ClusterCreateParametersExtended, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_parameters_extended.rb' + autoload :ScriptActionPersistedGetResponseSpec, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_persisted_get_response_spec.rb' + autoload :AutoscaleSchedule, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/autoscale_schedule.rb' + autoload :ScriptActionsList, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_actions_list.rb' autoload :RuntimeScriptActionDetail, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action_detail.rb' autoload :TrackedResource, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/tracked_resource.rb' autoload :Cluster, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster.rb' diff --git a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb b/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb index edb321465..b305ac26b 100644 --- a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb +++ b/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb @@ -158,7 +158,7 @@ module Azure::Hdinsight::Mgmt::V2018_06_01_preview # def add_telemetry sdk_information = 'azure_mgmt_hdinsight' - sdk_information = "#{sdk_information}/0.17.8" + sdk_information = "#{sdk_information}/0.18.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/virtual_machines.rb b/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/virtual_machines.rb index 594430076..9cb0e8f07 100644 --- a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/virtual_machines.rb +++ b/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/virtual_machines.rb @@ -29,7 +29,7 @@ module Azure::Hdinsight::Mgmt::V2018_06_01_preview # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [HostInfoListResult] operation results. + # @return [Array] operation results. # def list_hosts(resource_group_name, cluster_name, custom_headers:nil) response = list_hosts_async(resource_group_name, cluster_name, custom_headers:custom_headers).value! @@ -102,7 +102,23 @@ module Azure::Hdinsight::Mgmt::V2018_06_01_preview if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfoListResult.mapper() + result_mapper = { + client_side_validation: true, + required: false, + serialized_name: 'parsed_response', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'HostInfoElementType', + type: { + name: 'Composite', + class_name: 'HostInfo' + } + } + } + } result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) diff --git a/management/azure_mgmt_hdinsight/lib/profiles/latest/modules/hdinsight_profile_module.rb b/management/azure_mgmt_hdinsight/lib/profiles/latest/modules/hdinsight_profile_module.rb index 212da24e1..21edf03ee 100644 --- a/management/azure_mgmt_hdinsight/lib/profiles/latest/modules/hdinsight_profile_module.rb +++ b/management/azure_mgmt_hdinsight/lib/profiles/latest/modules/hdinsight_profile_module.rb @@ -18,81 +18,80 @@ module Azure::Hdinsight::Profiles::Latest module Models ClusterDiskEncryptionParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDiskEncryptionParameters - UpdateGatewaySettingsParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UpdateGatewaySettingsParameters - ClientGroupInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClientGroupInfo - GatewaySettings = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::GatewaySettings - SecurityProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SecurityProfile - OperationResource = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationResource - AutoscaleSchedule = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleSchedule - Resource = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Resource - AutoscaleRecurrence = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleRecurrence - AutoscaleCapacity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleCapacity - HardwareProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HardwareProfile - Autoscale = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Autoscale - DataDisksGroups = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DataDisksGroups - HostInfoListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfoListResult - SshProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshProfile - HostInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfo - OsProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OsProfile - ErrorResponse = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ErrorResponse - Role = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Role - ApplicationGetHttpsEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetHttpsEndpoint - StorageAccount = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageAccount - ApplicationGetEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetEndpoint - DiskEncryptionProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskEncryptionProperties - ApplicationProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationProperties - ClusterIdentityUserAssignedIdentitiesValue = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentityUserAssignedIdentitiesValue - OperationListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationListResult - ClusterCreateParametersExtended = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateParametersExtended - ApplicationListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationListResult - QuotaInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaInfo - VersionSpec = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionSpec - ConnectivityEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ConnectivityEndpoint - VersionsCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionsCapability - RegionsCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionsCapability - ExecuteScriptActionParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ExecuteScriptActionParameters - VmSizesCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizesCapability - ScriptActionExecutionSummary = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionSummary - VmSizeCompatibilityFilter = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilter - ClusterListRuntimeScriptActionDetailResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListRuntimeScriptActionDetailResult - RegionalQuotaCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionalQuotaCapability - ClusterResizeParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterResizeParameters - QuotaCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaCapability - KafkaRestProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::KafkaRestProperties - CapabilitiesResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::CapabilitiesResult - VirtualNetworkProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VirtualNetworkProfile - LocalizedName = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LocalizedName - LinuxOperatingSystemProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LinuxOperatingSystemProfile - Usage = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Usage - ComputeProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ComputeProfile - UsagesListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UsagesListResult - ClusterCreateProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateProperties - VmSizeCompatibilityFilterV2 = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilterV2 - ClusterPatchParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterPatchParameters - BillingMeters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingMeters - ClusterGetProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterGetProperties - DiskBillingMeters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskBillingMeters - ClusterListPersistedScriptActionsResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListPersistedScriptActionsResult - BillingResources = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResources - ClusterListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult - BillingResponseListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResponseListResult - AutoscaleTimeAndCapacity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleTimeAndCapacity - ClusterConfigurations = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterConfigurations - ScriptAction = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptAction - Extension = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Extension - ClusterIdentity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentity - ClusterMonitoringResponse = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringResponse - RuntimeScriptAction = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptAction - ClusterMonitoringRequest = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringRequest ClusterDefinition = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDefinition - ScriptActionExecutionHistoryList = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionHistoryList - StorageProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageProfile - ScriptActionPersistedGetResponseSpec = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionPersistedGetResponseSpec - Operation = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Operation + UpdateGatewaySettingsParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UpdateGatewaySettingsParameters + KafkaRestProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::KafkaRestProperties + GatewaySettings = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::GatewaySettings + AutoscaleTimeAndCapacity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleTimeAndCapacity + OperationResource = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationResource + AutoscaleCapacity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleCapacity + Resource = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Resource + Autoscale = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Autoscale + AutoscaleRecurrence = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleRecurrence + VirtualNetworkProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VirtualNetworkProfile + HardwareProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HardwareProfile SshPublicKey = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshPublicKey - ScriptActionsList = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionsList + HostInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfo + LinuxOperatingSystemProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LinuxOperatingSystemProfile + OperationListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationListResult + ScriptAction = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptAction + ErrorResponse = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ErrorResponse + ComputeProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ComputeProfile + ApplicationGetHttpsEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetHttpsEndpoint + StorageProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageProfile + ApplicationGetEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetEndpoint + ClusterCreateProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateProperties + ApplicationProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationProperties + ClusterIdentity = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentity + Operation = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Operation + ClusterPatchParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterPatchParameters + ApplicationListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationListResult Errors = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Errors + VersionSpec = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionSpec + ClusterGetProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterGetProperties + VersionsCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionsCapability + RuntimeScriptAction = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptAction + RegionsCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionsCapability + ClusterListPersistedScriptActionsResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListPersistedScriptActionsResult + VmSizesCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizesCapability OperationDisplay = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationDisplay + ClusterListRuntimeScriptActionDetailResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListRuntimeScriptActionDetailResult + VmSizeCompatibilityFilter = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilter + ClusterResizeParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterResizeParameters + RegionalQuotaCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionalQuotaCapability + SecurityProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SecurityProfile + QuotaCapability = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaCapability + DataDisksGroups = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DataDisksGroups + CapabilitiesResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::CapabilitiesResult + OsProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OsProfile + LocalizedName = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LocalizedName + StorageAccount = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageAccount + Usage = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Usage + ClusterIdentityUserAssignedIdentitiesValue = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentityUserAssignedIdentitiesValue + UsagesListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UsagesListResult + QuotaInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaInfo + VmSizeCompatibilityFilterV2 = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilterV2 + BillingMeters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingMeters + ScriptActionExecutionSummary = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionSummary + DiskBillingMeters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskBillingMeters + ClientGroupInfo = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClientGroupInfo + BillingResources = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResources + SshProfile = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshProfile + BillingResponseListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResponseListResult + DiskEncryptionProperties = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskEncryptionProperties + ClusterConfigurations = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterConfigurations + ConnectivityEndpoint = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ConnectivityEndpoint + Extension = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Extension + ClusterListResult = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult + ClusterMonitoringResponse = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringResponse + Role = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Role + ClusterMonitoringRequest = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringRequest + ExecuteScriptActionParameters = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ExecuteScriptActionParameters + ScriptActionExecutionHistoryList = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionHistoryList + ClusterCreateParametersExtended = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateParametersExtended + ScriptActionPersistedGetResponseSpec = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionPersistedGetResponseSpec + AutoscaleSchedule = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleSchedule + ScriptActionsList = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionsList RuntimeScriptActionDetail = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptActionDetail TrackedResource = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::TrackedResource Cluster = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Cluster @@ -165,231 +164,228 @@ module Azure::Hdinsight::Profiles::Latest def cluster_disk_encryption_parameters Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDiskEncryptionParameters end + def cluster_definition + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDefinition + end def update_gateway_settings_parameters Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UpdateGatewaySettingsParameters end - def client_group_info - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClientGroupInfo - end - def gateway_settings - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::GatewaySettings - end - def security_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SecurityProfile - end - def operation_resource - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationResource - end - def autoscale_schedule - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleSchedule - end - def resource - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Resource - end - def autoscale_recurrence - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleRecurrence - end - def autoscale_capacity - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleCapacity - end - def hardware_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HardwareProfile - end - def autoscale - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Autoscale - end - def data_disks_groups - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DataDisksGroups - end - def host_info_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfoListResult - end - def ssh_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshProfile - end - def host_info - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfo - end - def os_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OsProfile - end - def error_response - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ErrorResponse - end - def role - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Role - end - def application_get_https_endpoint - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetHttpsEndpoint - end - def storage_account - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageAccount - end - def application_get_endpoint - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetEndpoint - end - def disk_encryption_properties - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskEncryptionProperties - end - def application_properties - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationProperties - end - def cluster_identity_user_assigned_identities_value - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentityUserAssignedIdentitiesValue - end - def operation_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationListResult - end - def cluster_create_parameters_extended - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateParametersExtended - end - def application_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationListResult - end - def quota_info - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaInfo - end - def version_spec - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionSpec - end - def connectivity_endpoint - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ConnectivityEndpoint - end - def versions_capability - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionsCapability - end - def regions_capability - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionsCapability - end - def execute_script_action_parameters - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ExecuteScriptActionParameters - end - def vm_sizes_capability - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizesCapability - end - def script_action_execution_summary - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionSummary - end - def vm_size_compatibility_filter - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilter - end - def cluster_list_runtime_script_action_detail_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListRuntimeScriptActionDetailResult - end - def regional_quota_capability - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionalQuotaCapability - end - def cluster_resize_parameters - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterResizeParameters - end - def quota_capability - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaCapability - end def kafka_rest_properties Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::KafkaRestProperties end - def capabilities_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::CapabilitiesResult - end - def virtual_network_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VirtualNetworkProfile - end - def localized_name - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LocalizedName - end - def linux_operating_system_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LinuxOperatingSystemProfile - end - def usage - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Usage - end - def compute_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ComputeProfile - end - def usages_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UsagesListResult - end - def cluster_create_properties - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateProperties - end - def vm_size_compatibility_filter_v2 - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilterV2 - end - def cluster_patch_parameters - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterPatchParameters - end - def billing_meters - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingMeters - end - def cluster_get_properties - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterGetProperties - end - def disk_billing_meters - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskBillingMeters - end - def cluster_list_persisted_script_actions_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListPersistedScriptActionsResult - end - def billing_resources - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResources - end - def cluster_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult - end - def billing_response_list_result - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResponseListResult + def gateway_settings + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::GatewaySettings end def autoscale_time_and_capacity Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleTimeAndCapacity end - def cluster_configurations - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterConfigurations + def operation_resource + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationResource end - def script_action - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptAction + def autoscale_capacity + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleCapacity end - def extension - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Extension + def resource + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Resource end - def cluster_identity - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentity + def autoscale + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Autoscale end - def cluster_monitoring_response - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringResponse + def autoscale_recurrence + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleRecurrence end - def runtime_script_action - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptAction + def virtual_network_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VirtualNetworkProfile end - def cluster_monitoring_request - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringRequest - end - def cluster_definition - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDefinition - end - def script_action_execution_history_list - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionHistoryList - end - def storage_profile - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageProfile - end - def script_action_persisted_get_response_spec - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionPersistedGetResponseSpec - end - def operation - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Operation + def hardware_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HardwareProfile end def ssh_public_key Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshPublicKey end - def script_actions_list - Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionsList + def host_info + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::HostInfo + end + def linux_operating_system_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LinuxOperatingSystemProfile + end + def operation_list_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationListResult + end + def script_action + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptAction + end + def error_response + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ErrorResponse + end + def compute_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ComputeProfile + end + def application_get_https_endpoint + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetHttpsEndpoint + end + def storage_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageProfile + end + def application_get_endpoint + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationGetEndpoint + end + def cluster_create_properties + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateProperties + end + def application_properties + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationProperties + end + def cluster_identity + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentity + end + def operation + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Operation + end + def cluster_patch_parameters + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterPatchParameters + end + def application_list_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationListResult end def errors Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Errors end + def version_spec + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionSpec + end + def cluster_get_properties + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterGetProperties + end + def versions_capability + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VersionsCapability + end + def runtime_script_action + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptAction + end + def regions_capability + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionsCapability + end + def cluster_list_persisted_script_actions_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListPersistedScriptActionsResult + end + def vm_sizes_capability + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizesCapability + end def operation_display Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OperationDisplay end + def cluster_list_runtime_script_action_detail_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListRuntimeScriptActionDetailResult + end + def vm_size_compatibility_filter + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilter + end + def cluster_resize_parameters + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterResizeParameters + end + def regional_quota_capability + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RegionalQuotaCapability + end + def security_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SecurityProfile + end + def quota_capability + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaCapability + end + def data_disks_groups + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DataDisksGroups + end + def capabilities_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::CapabilitiesResult + end + def os_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::OsProfile + end + def localized_name + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::LocalizedName + end + def storage_account + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::StorageAccount + end + def usage + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Usage + end + def cluster_identity_user_assigned_identities_value + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterIdentityUserAssignedIdentitiesValue + end + def usages_list_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::UsagesListResult + end + def quota_info + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::QuotaInfo + end + def vm_size_compatibility_filter_v2 + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::VmSizeCompatibilityFilterV2 + end + def billing_meters + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingMeters + end + def script_action_execution_summary + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionSummary + end + def disk_billing_meters + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskBillingMeters + end + def client_group_info + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClientGroupInfo + end + def billing_resources + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResources + end + def ssh_profile + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::SshProfile + end + def billing_response_list_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::BillingResponseListResult + end + def disk_encryption_properties + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::DiskEncryptionProperties + end + def cluster_configurations + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterConfigurations + end + def connectivity_endpoint + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ConnectivityEndpoint + end + def extension + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Extension + end + def cluster_list_result + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult + end + def cluster_monitoring_response + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringResponse + end + def role + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Role + end + def cluster_monitoring_request + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringRequest + end + def execute_script_action_parameters + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ExecuteScriptActionParameters + end + def script_action_execution_history_list + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionExecutionHistoryList + end + def cluster_create_parameters_extended + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateParametersExtended + end + def script_action_persisted_get_response_spec + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionPersistedGetResponseSpec + end + def autoscale_schedule + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleSchedule + end + def script_actions_list + Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ScriptActionsList + end def runtime_script_action_detail Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::RuntimeScriptActionDetail end diff --git a/management/azure_mgmt_hdinsight/lib/version.rb b/management/azure_mgmt_hdinsight/lib/version.rb index f6e123d28..f2a89c204 100644 --- a/management/azure_mgmt_hdinsight/lib/version.rb +++ b/management/azure_mgmt_hdinsight/lib/version.rb @@ -3,5 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. module Azure::Hdinsight::Mgmt - VERSION = '0.17.8' + VERSION = '0.18.0' end diff --git a/management/azure_mgmt_security/lib/2015-06-01-preview/generated/azure_mgmt_security/security_center.rb b/management/azure_mgmt_security/lib/2015-06-01-preview/generated/azure_mgmt_security/security_center.rb index 5bdddb8d9..df50f9506 100644 --- a/management/azure_mgmt_security/lib/2015-06-01-preview/generated/azure_mgmt_security/security_center.rb +++ b/management/azure_mgmt_security/lib/2015-06-01-preview/generated/azure_mgmt_security/security_center.rb @@ -168,7 +168,7 @@ module Azure::Security::Mgmt::V2015_06_01_preview # def add_telemetry sdk_information = 'azure_mgmt_security' - sdk_information = "#{sdk_information}/0.18.1" + sdk_information = "#{sdk_information}/0.18.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_security/lib/2017-08-01-preview/generated/azure_mgmt_security/security_center.rb b/management/azure_mgmt_security/lib/2017-08-01-preview/generated/azure_mgmt_security/security_center.rb index 613edbef4..a9c2bfcf0 100644 --- a/management/azure_mgmt_security/lib/2017-08-01-preview/generated/azure_mgmt_security/security_center.rb +++ b/management/azure_mgmt_security/lib/2017-08-01-preview/generated/azure_mgmt_security/security_center.rb @@ -193,7 +193,7 @@ module Azure::Security::Mgmt::V2017_08_01_preview # def add_telemetry sdk_information = 'azure_mgmt_security' - sdk_information = "#{sdk_information}/0.18.1" + sdk_information = "#{sdk_information}/0.18.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_security/lib/2017-08-01/generated/azure_mgmt_security/security_center.rb b/management/azure_mgmt_security/lib/2017-08-01/generated/azure_mgmt_security/security_center.rb index 6aa58ffe8..016827c8a 100644 --- a/management/azure_mgmt_security/lib/2017-08-01/generated/azure_mgmt_security/security_center.rb +++ b/management/azure_mgmt_security/lib/2017-08-01/generated/azure_mgmt_security/security_center.rb @@ -121,7 +121,7 @@ module Azure::Security::Mgmt::V2017_08_01 # def add_telemetry sdk_information = 'azure_mgmt_security' - sdk_information = "#{sdk_information}/0.18.1" + sdk_information = "#{sdk_information}/0.18.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_security/lib/2018-06-01/generated/azure_mgmt_security/security_center.rb b/management/azure_mgmt_security/lib/2018-06-01/generated/azure_mgmt_security/security_center.rb index f3e33ce2c..004d53d3d 100644 --- a/management/azure_mgmt_security/lib/2018-06-01/generated/azure_mgmt_security/security_center.rb +++ b/management/azure_mgmt_security/lib/2018-06-01/generated/azure_mgmt_security/security_center.rb @@ -124,7 +124,7 @@ module Azure::Security::Mgmt::V2018_06_01 # def add_telemetry sdk_information = 'azure_mgmt_security' - sdk_information = "#{sdk_information}/0.18.1" + sdk_information = "#{sdk_information}/0.18.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_security/lib/2019-01-01-preview/generated/azure_mgmt_security/security_center.rb b/management/azure_mgmt_security/lib/2019-01-01-preview/generated/azure_mgmt_security/security_center.rb index 0073acbf1..8e88e85f1 100644 --- a/management/azure_mgmt_security/lib/2019-01-01-preview/generated/azure_mgmt_security/security_center.rb +++ b/management/azure_mgmt_security/lib/2019-01-01-preview/generated/azure_mgmt_security/security_center.rb @@ -138,7 +138,7 @@ module Azure::Security::Mgmt::V2019_01_01_preview # def add_telemetry sdk_information = 'azure_mgmt_security' - sdk_information = "#{sdk_information}/0.18.1" + sdk_information = "#{sdk_information}/0.18.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_security/lib/2019-01-01/generated/azure_mgmt_security/security_center.rb b/management/azure_mgmt_security/lib/2019-01-01/generated/azure_mgmt_security/security_center.rb index 1514da0b2..6a81edbda 100644 --- a/management/azure_mgmt_security/lib/2019-01-01/generated/azure_mgmt_security/security_center.rb +++ b/management/azure_mgmt_security/lib/2019-01-01/generated/azure_mgmt_security/security_center.rb @@ -132,7 +132,7 @@ module Azure::Security::Mgmt::V2019_01_01 # def add_telemetry sdk_information = 'azure_mgmt_security' - sdk_information = "#{sdk_information}/0.18.1" + sdk_information = "#{sdk_information}/0.18.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_security/lib/2019-08-01/generated/azure_mgmt_security/security_center.rb b/management/azure_mgmt_security/lib/2019-08-01/generated/azure_mgmt_security/security_center.rb index 4ef48ae39..650b325b1 100644 --- a/management/azure_mgmt_security/lib/2019-08-01/generated/azure_mgmt_security/security_center.rb +++ b/management/azure_mgmt_security/lib/2019-08-01/generated/azure_mgmt_security/security_center.rb @@ -157,7 +157,7 @@ module Azure::Security::Mgmt::V2019_08_01 # def add_telemetry sdk_information = 'azure_mgmt_security' - sdk_information = "#{sdk_information}/0.18.1" + sdk_information = "#{sdk_information}/0.18.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security.rb new file mode 100644 index 000000000..ed1b36223 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require '2020-01-01-preview/generated/azure_mgmt_security/module_definition' +require 'ms_rest_azure' + +module Azure::Security::Mgmt::V2020_01_01_preview + autoload :SecureScores, '2020-01-01-preview/generated/azure_mgmt_security/secure_scores.rb' + autoload :SecureScoreControls, '2020-01-01-preview/generated/azure_mgmt_security/secure_score_controls.rb' + autoload :SecureScoreControlDefinitions, '2020-01-01-preview/generated/azure_mgmt_security/secure_score_control_definitions.rb' + autoload :SecurityCenter, '2020-01-01-preview/generated/azure_mgmt_security/security_center.rb' + + module Models + autoload :SecureScoreControlDefinitionList, '2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_list.rb' + autoload :Resource, '2020-01-01-preview/generated/azure_mgmt_security/models/resource.rb' + autoload :SecureScoreControlList, '2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_list.rb' + autoload :SecureScoreControlScore, '2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_score.rb' + autoload :Tags, '2020-01-01-preview/generated/azure_mgmt_security/models/tags.rb' + autoload :AzureResourceLink, '2020-01-01-preview/generated/azure_mgmt_security/models/azure_resource_link.rb' + autoload :ETag, '2020-01-01-preview/generated/azure_mgmt_security/models/etag.rb' + autoload :SecureScoresList, '2020-01-01-preview/generated/azure_mgmt_security/models/secure_scores_list.rb' + autoload :TrackedResource, '2020-01-01-preview/generated/azure_mgmt_security/models/tracked_resource.rb' + autoload :Location, '2020-01-01-preview/generated/azure_mgmt_security/models/location.rb' + autoload :SecureScoreControlDefinitionSource, '2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_source.rb' + autoload :Kind, '2020-01-01-preview/generated/azure_mgmt_security/models/kind.rb' + autoload :SecureScoreItem, '2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_item.rb' + autoload :SecureScoreControlDefinitionItem, '2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_item.rb' + autoload :SecureScoreControlDetails, '2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_details.rb' + autoload :AscLocation, '2020-01-01-preview/generated/azure_mgmt_security/models/asc_location.rb' + autoload :ControlType, '2020-01-01-preview/generated/azure_mgmt_security/models/control_type.rb' + autoload :ExpandControlsEnum, '2020-01-01-preview/generated/azure_mgmt_security/models/expand_controls_enum.rb' + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/asc_location.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/asc_location.rb new file mode 100644 index 000000000..90370bdd8 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/asc_location.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # The ASC location of the subscription is in the "name" field + # + class AscLocation < Resource + + include MsRestAzure + + # @return + attr_accessor :properties + + + # + # Mapper for AscLocation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AscLocation', + type: { + name: 'Composite', + class_name: 'AscLocation', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/azure_resource_link.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/azure_resource_link.rb new file mode 100644 index 000000000..a795d62e7 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/azure_resource_link.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Describes an Azure resource with kind + # + class AzureResourceLink + + include MsRestAzure + + # @return [String] Azure resource Id + attr_accessor :id + + + # + # Mapper for AzureResourceLink class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AzureResourceLink', + type: { + name: 'Composite', + class_name: 'AzureResourceLink', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/control_type.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/control_type.rb new file mode 100644 index 000000000..31b353f04 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/control_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Defines values for ControlType + # + module ControlType + BuiltIn = "BuiltIn" + Custom = "Custom" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/etag.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/etag.rb new file mode 100644 index 000000000..1d4fd9c28 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/etag.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Entity tag is used for comparing two or more entities from the same + # requested resource. + # + class ETag + + include MsRestAzure + + # @return [String] Entity tag is used for comparing two or more entities + # from the same requested resource. + attr_accessor :etag + + + # + # Mapper for ETag class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ETag', + type: { + name: 'Composite', + class_name: 'ETag', + model_properties: { + etag: { + client_side_validation: true, + required: false, + serialized_name: 'etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/expand_controls_enum.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/expand_controls_enum.rb new file mode 100644 index 000000000..c4f332405 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/expand_controls_enum.rb @@ -0,0 +1,15 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Defines values for ExpandControlsEnum + # + module ExpandControlsEnum + Definition = "definition" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/kind.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/kind.rb new file mode 100644 index 000000000..c864f9d49 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/kind.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Describes an Azure resource with kind + # + class Kind + + include MsRestAzure + + # @return [String] Kind of the resource + attr_accessor :kind + + + # + # Mapper for Kind class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Kind', + type: { + name: 'Composite', + class_name: 'Kind', + model_properties: { + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/location.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/location.rb new file mode 100644 index 000000000..cae55f9c0 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/location.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Describes an Azure resource with location + # + class Location + + include MsRestAzure + + # @return [String] Location where the resource is stored + attr_accessor :location + + + # + # Mapper for Location class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Location', + type: { + name: 'Composite', + class_name: 'Location', + model_properties: { + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/resource.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/resource.rb new file mode 100644 index 000000000..823a20a1b --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/resource.rb @@ -0,0 +1,80 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Describes an Azure resource. + # + class Resource + + include MsRestAzure + + # @return [String] Resource Id + attr_accessor :id + + # @return [String] Resource name + attr_accessor :name + + # @return [String] Resource type + attr_accessor :type + + + # @return [String] the name of the resource group of the resource. + def resource_group + unless self.id.nil? + groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/) + groups.captures[0].strip if groups + end + end + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_item.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_item.rb new file mode 100644 index 000000000..7fdf61582 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_item.rb @@ -0,0 +1,141 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Information about the security control. + # + class SecureScoreControlDefinitionItem < Resource + + include MsRestAzure + + # @return [String] User friendly display name of the control + attr_accessor :display_name + + # @return [String] User friendly description of the control + attr_accessor :description + + # @return [Integer] Maximum control score (0..10) + attr_accessor :max_score + + # @return [SecureScoreControlDefinitionSource] Source object from which + # the control was created + attr_accessor :source + + # @return [Array] Array of assessments metadata IDs + # that are included in this security control + attr_accessor :assessment_definitions + + + # + # Mapper for SecureScoreControlDefinitionItem class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecureScoreControlDefinitionItem', + type: { + name: 'Composite', + class_name: 'SecureScoreControlDefinitionItem', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + display_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.description', + constraints: { + MaxLength: 256 + }, + type: { + name: 'String' + } + }, + max_score: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.maxScore', + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, + source: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.source', + type: { + name: 'Composite', + class_name: 'SecureScoreControlDefinitionSource' + } + }, + assessment_definitions: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.assessmentDefinitions', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'AzureResourceLinkElementType', + type: { + name: 'Composite', + class_name: 'AzureResourceLink' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_list.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_list.rb new file mode 100644 index 000000000..4b9944f84 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_list.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # List of security controls definition + # + class SecureScoreControlDefinitionList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Collection of + # security controls definition in this page + attr_accessor :value + + # @return [String] The URI to fetch the next page. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [SecureScoreControlDefinitionList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for SecureScoreControlDefinitionList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'secureScoreControlDefinitionList', + type: { + name: 'Composite', + class_name: 'SecureScoreControlDefinitionList', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SecureScoreControlDefinitionItemElementType', + type: { + name: 'Composite', + class_name: 'SecureScoreControlDefinitionItem' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_source.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_source.rb new file mode 100644 index 000000000..dba90be8c --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_source.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # The type of the security control (For example, BuiltIn) + # + class SecureScoreControlDefinitionSource + + include MsRestAzure + + # @return [ControlType] The type of security control (for example, + # BuiltIn). Possible values include: 'BuiltIn', 'Custom' + attr_accessor :source_type + + + # + # Mapper for SecureScoreControlDefinitionSource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecureScoreControlDefinitionSource', + type: { + name: 'Composite', + class_name: 'SecureScoreControlDefinitionSource', + model_properties: { + source_type: { + client_side_validation: true, + required: false, + serialized_name: 'sourceType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_details.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_details.rb new file mode 100644 index 000000000..6924052bc --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_details.rb @@ -0,0 +1,153 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Details of the security control, its score, and the health status of the + # relevant resources. + # + class SecureScoreControlDetails < Resource + + include MsRestAzure + + # @return [String] User friendly display name of the control + attr_accessor :display_name + + # @return [Integer] Maximum score available + attr_accessor :max + + # @return [Float] Current score + attr_accessor :current + + # @return [Integer] Number of healthy resources in the control + attr_accessor :healthy_resource_count + + # @return [Integer] Number of unhealthy resources in the control + attr_accessor :unhealthy_resource_count + + # @return [Integer] Number of not applicable resources in the control + attr_accessor :not_applicable_resource_count + + # @return [SecureScoreControlDefinitionItem] + attr_accessor :definition + + + # + # Mapper for SecureScoreControlDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecureScoreControlDetails', + type: { + name: 'Composite', + class_name: 'SecureScoreControlDetails', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + display_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + max: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.score.max', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, + current: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.score.current', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Double' + } + }, + healthy_resource_count: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.healthyResourceCount', + type: { + name: 'Number' + } + }, + unhealthy_resource_count: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.unhealthyResourceCount', + type: { + name: 'Number' + } + }, + not_applicable_resource_count: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.notApplicableResourceCount', + type: { + name: 'Number' + } + }, + definition: { + client_side_validation: true, + required: false, + serialized_name: 'properties.definition', + type: { + name: 'Composite', + class_name: 'SecureScoreControlDefinitionItem' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_list.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_list.rb new file mode 100644 index 000000000..0ac4d300d --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_list.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # List of security controls + # + class SecureScoreControlList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Collection of security + # controls in this page + attr_accessor :value + + # @return [String] The URI to fetch the next page. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [SecureScoreControlList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for SecureScoreControlList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecureScoreControlList', + type: { + name: 'Composite', + class_name: 'SecureScoreControlList', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SecureScoreControlDetailsElementType', + type: { + name: 'Composite', + class_name: 'SecureScoreControlDetails' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_score.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_score.rb new file mode 100644 index 000000000..e546ea8ba --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_score.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Calculation result data + # + class SecureScoreControlScore + + include MsRestAzure + + # @return [Integer] Maximum control score (0..10) + attr_accessor :max + + # @return [Float] Actual score for the control = (achieved points / total + # points) * max score. if total points is zeroed, the return number is + # 0.00 + attr_accessor :current + + + # + # Mapper for SecureScoreControlScore class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecureScoreControlScore', + type: { + name: 'Composite', + class_name: 'SecureScoreControlScore', + model_properties: { + max: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'max', + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, + current: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'current', + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 0 + }, + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_item.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_item.rb new file mode 100644 index 000000000..507b72164 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_item.rb @@ -0,0 +1,104 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Secure score item data model + # + class SecureScoreItem < Resource + + include MsRestAzure + + # @return [String] The initiative’s name + attr_accessor :display_name + + # @return [Integer] Maximum score available + attr_accessor :max + + # @return [Float] Current score + attr_accessor :current + + + # + # Mapper for SecureScoreItem class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecureScoreItem', + type: { + name: 'Composite', + class_name: 'SecureScoreItem', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + display_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + max: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.score.max', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, + current: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.score.current', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_scores_list.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_scores_list.rb new file mode 100644 index 000000000..e5231267e --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_scores_list.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # List of secure scores + # + class SecureScoresList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Collection of secure scores in this + # page + attr_accessor :value + + # @return [String] The URI to fetch the next page. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [SecureScoresList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for SecureScoresList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecureScoresList', + type: { + name: 'Composite', + class_name: 'SecureScoresList', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SecureScoreItemElementType', + type: { + name: 'Composite', + class_name: 'SecureScoreItem' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/tags.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/tags.rb new file mode 100644 index 000000000..8ba8a71b3 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/tags.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # A list of key value pairs that describe the resource. + # + class Tags + + include MsRestAzure + + # @return [Hash{String => String}] A list of key value pairs that + # describe the resource. + attr_accessor :tags + + + # + # Mapper for Tags class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Tags', + type: { + name: 'Composite', + class_name: 'Tags', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/tracked_resource.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/tracked_resource.rb new file mode 100644 index 000000000..2f276fe64 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/models/tracked_resource.rb @@ -0,0 +1,126 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + module Models + # + # Describes an Azure tracked resource. + # + class TrackedResource + + include MsRestAzure + + # @return [String] Resource Id + attr_accessor :id + + # @return [String] Resource name + attr_accessor :name + + # @return [String] Resource type + attr_accessor :type + + # @return [String] Location where the resource is stored + attr_accessor :location + + # @return [String] Kind of the resource + attr_accessor :kind + + # @return [String] Entity tag is used for comparing two or more entities + # from the same requested resource. + attr_accessor :etag + + # @return [Hash{String => String}] A list of key value pairs that + # describe the resource. + attr_accessor :tags + + + # + # Mapper for TrackedResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TrackedResource', + type: { + name: 'Composite', + class_name: 'TrackedResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + type: { + name: 'String' + } + }, + etag: { + client_side_validation: true, + required: false, + serialized_name: 'etag', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/module_definition.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/module_definition.rb new file mode 100644 index 000000000..0147c1ec4 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/module_definition.rb @@ -0,0 +1,9 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::Security end +module Azure::Security::Mgmt end +module Azure::Security::Mgmt::V2020_01_01_preview end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_score_control_definitions.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_score_control_definitions.rb new file mode 100644 index 000000000..068bd5a67 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_score_control_definitions.rb @@ -0,0 +1,423 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class SecureScoreControlDefinitions + include MsRestAzure + + # + # Creates and initializes a new instance of the SecureScoreControlDefinitions class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # List the available security controls, their assessments, and the max score + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers:nil) + first_page = list_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List the available security controls, their assessments, and the max score + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # List the available security controls, their assessments, and the max score + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.Security/secureScoreControlDefinitions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01_preview::Models::SecureScoreControlDefinitionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # For a specified subscription, list the available security controls, their + # assessments, and the max score + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_subscription(custom_headers:nil) + first_page = list_by_subscription_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # For a specified subscription, list the available security controls, their + # assessments, and the max score + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_with_http_info(custom_headers:nil) + list_by_subscription_async(custom_headers:custom_headers).value! + end + + # + # For a specified subscription, list the available security controls, their + # assessments, and the max score + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01_preview::Models::SecureScoreControlDefinitionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List the available security controls, their assessments, and the max score + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecureScoreControlDefinitionList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List the available security controls, their assessments, and the max score + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List the available security controls, their assessments, and the max score + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01_preview::Models::SecureScoreControlDefinitionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # For a specified subscription, list the available security controls, their + # assessments, and the max score + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecureScoreControlDefinitionList] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers:nil) + response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # For a specified subscription, list the available security controls, their + # assessments, and the max score + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil) + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # For a specified subscription, list the available security controls, their + # assessments, and the max score + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01_preview::Models::SecureScoreControlDefinitionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List the available security controls, their assessments, and the max score + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecureScoreControlDefinitionList] which provide lazy access to pages + # of the response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # For a specified subscription, list the available security controls, their + # assessments, and the max score + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecureScoreControlDefinitionList] which provide lazy access to pages + # of the response. + # + def list_by_subscription_as_lazy(custom_headers:nil) + response = list_by_subscription_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_score_controls.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_score_controls.rb new file mode 100644 index 000000000..bde987bac --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_score_controls.rb @@ -0,0 +1,444 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class SecureScoreControls + include MsRestAzure + + # + # Creates and initializes a new instance of the SecureScoreControls class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # Get all security controls for a specific initiative within a scope + # + # @param secure_score_name [String] The initiative name. For the ASC Default + # initiative, use 'ascScore' as in the sample request below. + # @param expand [ExpandControlsEnum] OData expand. Optional. Possible values + # include: 'definition' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_secure_score(secure_score_name, expand:nil, custom_headers:nil) + first_page = list_by_secure_score_as_lazy(secure_score_name, expand:expand, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Get all security controls for a specific initiative within a scope + # + # @param secure_score_name [String] The initiative name. For the ASC Default + # initiative, use 'ascScore' as in the sample request below. + # @param expand [ExpandControlsEnum] OData expand. Optional. Possible values + # include: 'definition' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_secure_score_with_http_info(secure_score_name, expand:nil, custom_headers:nil) + list_by_secure_score_async(secure_score_name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get all security controls for a specific initiative within a scope + # + # @param secure_score_name [String] The initiative name. For the ASC Default + # initiative, use 'ascScore' as in the sample request below. + # @param expand [ExpandControlsEnum] OData expand. Optional. Possible values + # include: 'definition' + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_secure_score_async(secure_score_name, expand:nil, custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'secure_score_name is nil' if secure_score_name.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'secureScoreName' => secure_score_name}, + query_params: {'api-version' => @client.api_version,'$expand' => expand}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01_preview::Models::SecureScoreControlList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get all security controls within a scope + # + # @param expand [ExpandControlsEnum] OData expand. Optional. Possible values + # include: 'definition' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(expand:nil, custom_headers:nil) + first_page = list_as_lazy(expand:expand, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Get all security controls within a scope + # + # @param expand [ExpandControlsEnum] OData expand. Optional. Possible values + # include: 'definition' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(expand:nil, custom_headers:nil) + list_async(expand:expand, custom_headers:custom_headers).value! + end + + # + # Get all security controls within a scope + # + # @param expand [ExpandControlsEnum] OData expand. Optional. Possible values + # include: 'definition' + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(expand:nil, custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$expand' => expand}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01_preview::Models::SecureScoreControlList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get all security controls for a specific initiative within a scope + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecureScoreControlList] operation results. + # + def list_by_secure_score_next(next_page_link, custom_headers:nil) + response = list_by_secure_score_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get all security controls for a specific initiative within a scope + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_secure_score_next_with_http_info(next_page_link, custom_headers:nil) + list_by_secure_score_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Get all security controls for a specific initiative within a scope + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_secure_score_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01_preview::Models::SecureScoreControlList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get all security controls within a scope + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecureScoreControlList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get all security controls within a scope + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Get all security controls within a scope + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01_preview::Models::SecureScoreControlList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get all security controls for a specific initiative within a scope + # + # @param secure_score_name [String] The initiative name. For the ASC Default + # initiative, use 'ascScore' as in the sample request below. + # @param expand [ExpandControlsEnum] OData expand. Optional. Possible values + # include: 'definition' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecureScoreControlList] which provide lazy access to pages of the + # response. + # + def list_by_secure_score_as_lazy(secure_score_name, expand:nil, custom_headers:nil) + response = list_by_secure_score_async(secure_score_name, expand:expand, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_secure_score_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # Get all security controls within a scope + # + # @param expand [ExpandControlsEnum] OData expand. Optional. Possible values + # include: 'definition' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecureScoreControlList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(expand:nil, custom_headers:nil) + response = list_async(expand:expand, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_scores.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_scores.rb new file mode 100644 index 000000000..24b1baff3 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_scores.rb @@ -0,0 +1,326 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class SecureScores + include MsRestAzure + + # + # Creates and initializes a new instance of the SecureScores class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # List secure scores for all your Security Center initiatives within your + # current scope. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers:nil) + first_page = list_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List secure scores for all your Security Center initiatives within your + # current scope. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # List secure scores for all your Security Center initiatives within your + # current scope. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01_preview::Models::SecureScoresList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get secure score for a specific Security Center initiative within your + # current scope. For the ASC Default initiative, use 'ascScore'. + # + # @param secure_score_name [String] The initiative name. For the ASC Default + # initiative, use 'ascScore' as in the sample request below. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecureScoreItem] operation results. + # + def get(secure_score_name, custom_headers:nil) + response = get_async(secure_score_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get secure score for a specific Security Center initiative within your + # current scope. For the ASC Default initiative, use 'ascScore'. + # + # @param secure_score_name [String] The initiative name. For the ASC Default + # initiative, use 'ascScore' as in the sample request below. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(secure_score_name, custom_headers:nil) + get_async(secure_score_name, custom_headers:custom_headers).value! + end + + # + # Get secure score for a specific Security Center initiative within your + # current scope. For the ASC Default initiative, use 'ascScore'. + # + # @param secure_score_name [String] The initiative name. For the ASC Default + # initiative, use 'ascScore' as in the sample request below. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(secure_score_name, custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'secure_score_name is nil' if secure_score_name.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'secureScoreName' => secure_score_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01_preview::Models::SecureScoreItem.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List secure scores for all your Security Center initiatives within your + # current scope. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecureScoresList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List secure scores for all your Security Center initiatives within your + # current scope. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List secure scores for all your Security Center initiatives within your + # current scope. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01_preview::Models::SecureScoresList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List secure scores for all your Security Center initiatives within your + # current scope. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecureScoresList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/security_center.rb b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/security_center.rb new file mode 100644 index 000000000..036dfc932 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01-preview/generated/azure_mgmt_security/security_center.rb @@ -0,0 +1,139 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01_preview + # + # A service client - single point of access to the REST API. + # + class SecurityCenter < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] Azure subscription ID + attr_accessor :subscription_id + + # @return [String] API version for the operation + attr_reader :api_version + + # @return [String] The preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] The retry timeout in seconds for Long Running + # Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] Whether a unique x-ms-client-request-id should be + # generated. When set to true a unique x-ms-client-request-id value is + # generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [SecureScores] secure_scores + attr_reader :secure_scores + + # @return [SecureScoreControls] secure_score_controls + attr_reader :secure_score_controls + + # @return [SecureScoreControlDefinitions] secure_score_control_definitions + attr_reader :secure_score_control_definitions + + # + # Creates initializes a new instance of the SecurityCenter class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @secure_scores = SecureScores.new(self) + @secure_score_controls = SecureScoreControls.new(self) + @secure_score_control_definitions = SecureScoreControlDefinitions.new(self) + @api_version = '2020-01-01-preview' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) + @request_headers['Content-Type'] = options[:headers]['Content-Type'] + end + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_security' + sdk_information = "#{sdk_information}/0.18.2" + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security.rb new file mode 100644 index 000000000..f8f4aca4a --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security.rb @@ -0,0 +1,121 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require '2020-01-01/generated/azure_mgmt_security/module_definition' +require 'ms_rest_azure' + +module Azure::Security::Mgmt::V2020_01_01 + autoload :AdaptiveNetworkHardenings, '2020-01-01/generated/azure_mgmt_security/adaptive_network_hardenings.rb' + autoload :AllowedConnections, '2020-01-01/generated/azure_mgmt_security/allowed_connections.rb' + autoload :AdaptiveApplicationControls, '2020-01-01/generated/azure_mgmt_security/adaptive_application_controls.rb' + autoload :AssessmentsMetadata, '2020-01-01/generated/azure_mgmt_security/assessments_metadata.rb' + autoload :Assessments, '2020-01-01/generated/azure_mgmt_security/assessments.rb' + autoload :DiscoveredSecuritySolutions, '2020-01-01/generated/azure_mgmt_security/discovered_security_solutions.rb' + autoload :ExternalSecuritySolutions, '2020-01-01/generated/azure_mgmt_security/external_security_solutions.rb' + autoload :JitNetworkAccessPolicies, '2020-01-01/generated/azure_mgmt_security/jit_network_access_policies.rb' + autoload :ServerVulnerabilityAssessmentOperations, '2020-01-01/generated/azure_mgmt_security/server_vulnerability_assessment_operations.rb' + autoload :Topology, '2020-01-01/generated/azure_mgmt_security/topology.rb' + autoload :SecurityCenter, '2020-01-01/generated/azure_mgmt_security/security_center.rb' + + module Models + autoload :ResourceDetails, '2020-01-01/generated/azure_mgmt_security/models/resource_details.rb' + autoload :Rule, '2020-01-01/generated/azure_mgmt_security/models/rule.rb' + autoload :AssessmentStatus, '2020-01-01/generated/azure_mgmt_security/models/assessment_status.rb' + autoload :EffectiveNetworkSecurityGroups, '2020-01-01/generated/azure_mgmt_security/models/effective_network_security_groups.rb' + autoload :AdaptiveNetworkHardeningsList, '2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardenings_list.rb' + autoload :JitNetworkAccessPolicy, '2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy.rb' + autoload :JitNetworkAccessPolicyInitiatePort, '2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_port.rb' + autoload :AssessmentLinks, '2020-01-01/generated/azure_mgmt_security/models/assessment_links.rb' + autoload :Location, '2020-01-01/generated/azure_mgmt_security/models/location.rb' + autoload :SecurityAssessmentPartnerData, '2020-01-01/generated/azure_mgmt_security/models/security_assessment_partner_data.rb' + autoload :ETag, '2020-01-01/generated/azure_mgmt_security/models/etag.rb' + autoload :TopologyList, '2020-01-01/generated/azure_mgmt_security/models/topology_list.rb' + autoload :Resource, '2020-01-01/generated/azure_mgmt_security/models/resource.rb' + autoload :SecurityAssessmentList, '2020-01-01/generated/azure_mgmt_security/models/security_assessment_list.rb' + autoload :ConnectedResource, '2020-01-01/generated/azure_mgmt_security/models/connected_resource.rb' + autoload :TopologyResource, '2020-01-01/generated/azure_mgmt_security/models/topology_resource.rb' + autoload :AllowedConnectionsResource, '2020-01-01/generated/azure_mgmt_security/models/allowed_connections_resource.rb' + autoload :TopologySingleResource, '2020-01-01/generated/azure_mgmt_security/models/topology_single_resource.rb' + autoload :ProtectionMode, '2020-01-01/generated/azure_mgmt_security/models/protection_mode.rb' + autoload :DiscoveredSecuritySolution, '2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution.rb' + autoload :VmRecommendation, '2020-01-01/generated/azure_mgmt_security/models/vm_recommendation.rb' + autoload :DiscoveredSecuritySolutionList, '2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution_list.rb' + autoload :UserRecommendation, '2020-01-01/generated/azure_mgmt_security/models/user_recommendation.rb' + autoload :ExternalSecuritySolution, '2020-01-01/generated/azure_mgmt_security/models/external_security_solution.rb' + autoload :AppWhitelistingGroup, '2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_group.rb' + autoload :ExternalSecuritySolutionList, '2020-01-01/generated/azure_mgmt_security/models/external_security_solution_list.rb' + autoload :SecurityAssessmentMetadataPartnerData, '2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_partner_data.rb' + autoload :TopologySingleResourceChild, '2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_child.rb' + autoload :JitNetworkAccessPoliciesList, '2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policies_list.rb' + autoload :TopologySingleResourceParent, '2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_parent.rb' + autoload :AdaptiveNetworkHardeningEnforceRequest, '2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening_enforce_request.rb' + autoload :ServerVulnerabilityAssessmentsList, '2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessments_list.rb' + autoload :Kind, '2020-01-01/generated/azure_mgmt_security/models/kind.rb' + autoload :JitNetworkAccessPolicyInitiateRequest, '2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_request.rb' + autoload :ConnectedWorkspace, '2020-01-01/generated/azure_mgmt_security/models/connected_workspace.rb' + autoload :AllowedConnectionsList, '2020-01-01/generated/azure_mgmt_security/models/allowed_connections_list.rb' + autoload :AadSolutionProperties, '2020-01-01/generated/azure_mgmt_security/models/aad_solution_properties.rb' + autoload :PublisherInfo, '2020-01-01/generated/azure_mgmt_security/models/publisher_info.rb' + autoload :JitNetworkAccessPolicyInitiateVirtualMachine, '2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_virtual_machine.rb' + autoload :AppWhitelistingGroups, '2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_groups.rb' + autoload :ExternalSecuritySolutionKind1, '2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind1.rb' + autoload :SecurityAssessmentMetadataList, '2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_list.rb' + autoload :ExternalSecuritySolutionProperties, '2020-01-01/generated/azure_mgmt_security/models/external_security_solution_properties.rb' + autoload :Tags, '2020-01-01/generated/azure_mgmt_security/models/tags.rb' + autoload :AadConnectivityState1, '2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state1.rb' + autoload :AppWhitelistingIssueSummary, '2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_issue_summary.rb' + autoload :JitNetworkAccessPortRule, '2020-01-01/generated/azure_mgmt_security/models/jit_network_access_port_rule.rb' + autoload :SecurityAssessmentMetadataProperties, '2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_properties.rb' + autoload :JitNetworkAccessPolicyVirtualMachine, '2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_virtual_machine.rb' + autoload :ConnectableResource, '2020-01-01/generated/azure_mgmt_security/models/connectable_resource.rb' + autoload :JitNetworkAccessRequestPort, '2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_port.rb' + autoload :TrackedResource, '2020-01-01/generated/azure_mgmt_security/models/tracked_resource.rb' + autoload :JitNetworkAccessRequestVirtualMachine, '2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_virtual_machine.rb' + autoload :PathRecommendation, '2020-01-01/generated/azure_mgmt_security/models/path_recommendation.rb' + autoload :JitNetworkAccessRequest, '2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request.rb' + autoload :AdaptiveNetworkHardening, '2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening.rb' + autoload :AscLocation, '2020-01-01/generated/azure_mgmt_security/models/asc_location.rb' + autoload :SecurityAssessmentMetadata, '2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata.rb' + autoload :SecurityAssessment, '2020-01-01/generated/azure_mgmt_security/models/security_assessment.rb' + autoload :OnPremiseResourceDetails, '2020-01-01/generated/azure_mgmt_security/models/on_premise_resource_details.rb' + autoload :AzureResourceDetails, '2020-01-01/generated/azure_mgmt_security/models/azure_resource_details.rb' + autoload :CefSolutionProperties, '2020-01-01/generated/azure_mgmt_security/models/cef_solution_properties.rb' + autoload :CefExternalSecuritySolution, '2020-01-01/generated/azure_mgmt_security/models/cef_external_security_solution.rb' + autoload :AtaSolutionProperties, '2020-01-01/generated/azure_mgmt_security/models/ata_solution_properties.rb' + autoload :AtaExternalSecuritySolution, '2020-01-01/generated/azure_mgmt_security/models/ata_external_security_solution.rb' + autoload :AadExternalSecuritySolution, '2020-01-01/generated/azure_mgmt_security/models/aad_external_security_solution.rb' + autoload :ServerVulnerabilityAssessment, '2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessment.rb' + autoload :Direction, '2020-01-01/generated/azure_mgmt_security/models/direction.rb' + autoload :TransportProtocol, '2020-01-01/generated/azure_mgmt_security/models/transport_protocol.rb' + autoload :Category, '2020-01-01/generated/azure_mgmt_security/models/category.rb' + autoload :Severity, '2020-01-01/generated/azure_mgmt_security/models/severity.rb' + autoload :UserImpact, '2020-01-01/generated/azure_mgmt_security/models/user_impact.rb' + autoload :ImplementationEffort, '2020-01-01/generated/azure_mgmt_security/models/implementation_effort.rb' + autoload :Threats, '2020-01-01/generated/azure_mgmt_security/models/threats.rb' + autoload :AssessmentType, '2020-01-01/generated/azure_mgmt_security/models/assessment_type.rb' + autoload :AssessmentStatusCode, '2020-01-01/generated/azure_mgmt_security/models/assessment_status_code.rb' + autoload :SecurityFamily, '2020-01-01/generated/azure_mgmt_security/models/security_family.rb' + autoload :AadConnectivityState, '2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state.rb' + autoload :ExternalSecuritySolutionKind, '2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind.rb' + autoload :Protocol, '2020-01-01/generated/azure_mgmt_security/models/protocol.rb' + autoload :Status, '2020-01-01/generated/azure_mgmt_security/models/status.rb' + autoload :StatusReason, '2020-01-01/generated/azure_mgmt_security/models/status_reason.rb' + autoload :ConnectionType, '2020-01-01/generated/azure_mgmt_security/models/connection_type.rb' + autoload :ExpandEnum, '2020-01-01/generated/azure_mgmt_security/models/expand_enum.rb' + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/adaptive_application_controls.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/adaptive_application_controls.rb new file mode 100644 index 000000000..013979512 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/adaptive_application_controls.rb @@ -0,0 +1,394 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class AdaptiveApplicationControls + include MsRestAzure + + # + # Creates and initializes a new instance of the AdaptiveApplicationControls class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # Gets a list of application control VM/server groups for the subscription. + # + # @param include_path_recommendations [Boolean] Include the policy rules + # @param summary [Boolean] Return output in a summarized form + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AppWhitelistingGroups] operation results. + # + def list(include_path_recommendations:nil, summary:nil, custom_headers:nil) + response = list_async(include_path_recommendations:include_path_recommendations, summary:summary, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a list of application control VM/server groups for the subscription. + # + # @param include_path_recommendations [Boolean] Include the policy rules + # @param summary [Boolean] Return output in a summarized form + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(include_path_recommendations:nil, summary:nil, custom_headers:nil) + list_async(include_path_recommendations:include_path_recommendations, summary:summary, custom_headers:custom_headers).value! + end + + # + # Gets a list of application control VM/server groups for the subscription. + # + # @param include_path_recommendations [Boolean] Include the policy rules + # @param summary [Boolean] Return output in a summarized form + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(include_path_recommendations:nil, summary:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'includePathRecommendations' => include_path_recommendations,'summary' => summary}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroups.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets an application control VM/server group. + # + # @param group_name [String] Name of an application control VM/server group + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AppWhitelistingGroup] operation results. + # + def get(group_name, custom_headers:nil) + response = get_async(group_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets an application control VM/server group. + # + # @param group_name [String] Name of an application control VM/server group + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(group_name, custom_headers:nil) + get_async(group_name, custom_headers:custom_headers).value! + end + + # + # Gets an application control VM/server group. + # + # @param group_name [String] Name of an application control VM/server group + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(group_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, 'group_name is nil' if group_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location,'groupName' => group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Update an application control VM/server group + # + # @param group_name [String] Name of an application control VM/server group + # @param body [AppWhitelistingGroup] + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AppWhitelistingGroup] operation results. + # + def put(group_name, body, custom_headers:nil) + response = put_async(group_name, body, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update an application control VM/server group + # + # @param group_name [String] Name of an application control VM/server group + # @param body [AppWhitelistingGroup] + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def put_with_http_info(group_name, body, custom_headers:nil) + put_async(group_name, body, custom_headers:custom_headers).value! + end + + # + # Update an application control VM/server group + # + # @param group_name [String] Name of an application control VM/server group + # @param body [AppWhitelistingGroup] + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def put_async(group_name, body, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, 'group_name is nil' if group_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'body is nil' if body.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroup.mapper() + request_content = @client.serialize(request_mapper, body) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location,'groupName' => group_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete an application control VM/server group + # + # @param group_name [String] Name of an application control VM/server group + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(group_name, custom_headers:nil) + response = delete_async(group_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete an application control VM/server group + # + # @param group_name [String] Name of an application control VM/server group + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def delete_with_http_info(group_name, custom_headers:nil) + delete_async(group_name, custom_headers:custom_headers).value! + end + + # + # Delete an application control VM/server group + # + # @param group_name [String] Name of an application control VM/server group + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def delete_async(group_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, 'group_name is nil' if group_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location,'groupName' => group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/adaptive_network_hardenings.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/adaptive_network_hardenings.rb new file mode 100644 index 000000000..fe79300e7 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/adaptive_network_hardenings.rb @@ -0,0 +1,539 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class AdaptiveNetworkHardenings + include MsRestAzure + + # + # Creates and initializes a new instance of the AdaptiveNetworkHardenings class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # Gets a list of Adaptive Network Hardenings resources in scope of an extended + # resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_extended_resource(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + first_page = list_by_extended_resource_as_lazy(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Gets a list of Adaptive Network Hardenings resources in scope of an extended + # resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_extended_resource_with_http_info(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + list_by_extended_resource_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:custom_headers).value! + end + + # + # Gets a list of Adaptive Network Hardenings resources in scope of an extended + # resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_extended_resource_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'resource_namespace is nil' if resource_namespace.nil? + fail ArgumentError, 'resource_type is nil' if resource_type.nil? + fail ArgumentError, 'resource_name is nil' if resource_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceNamespace' => resource_namespace,'resourceType' => resource_type,'resourceName' => resource_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardeningsList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a single Adaptive Network Hardening resource + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param adaptive_network_hardening_resource_name [String] The name of the + # Adaptive Network Hardening resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AdaptiveNetworkHardening] operation results. + # + def get(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, custom_headers:nil) + response = get_async(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a single Adaptive Network Hardening resource + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param adaptive_network_hardening_resource_name [String] The name of the + # Adaptive Network Hardening resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, custom_headers:nil) + get_async(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, custom_headers:custom_headers).value! + end + + # + # Gets a single Adaptive Network Hardening resource + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param adaptive_network_hardening_resource_name [String] The name of the + # Adaptive Network Hardening resource. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'resource_namespace is nil' if resource_namespace.nil? + fail ArgumentError, 'resource_type is nil' if resource_type.nil? + fail ArgumentError, 'resource_name is nil' if resource_name.nil? + fail ArgumentError, 'adaptive_network_hardening_resource_name is nil' if adaptive_network_hardening_resource_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceNamespace' => resource_namespace,'resourceType' => resource_type,'resourceName' => resource_name,'adaptiveNetworkHardeningResourceName' => adaptive_network_hardening_resource_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardening.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Enforces the given rules on the NSG(s) listed in the request + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param adaptive_network_hardening_resource_name [String] The name of the + # Adaptive Network Hardening resource. + # @param body [AdaptiveNetworkHardeningEnforceRequest] + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def enforce(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, body, custom_headers:nil) + response = enforce_async(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, body, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param adaptive_network_hardening_resource_name [String] The name of the + # Adaptive Network Hardening resource. + # @param body [AdaptiveNetworkHardeningEnforceRequest] + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def enforce_async(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, body, custom_headers:nil) + # Send request + promise = begin_enforce_async(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, body, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Enforces the given rules on the NSG(s) listed in the request + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param adaptive_network_hardening_resource_name [String] The name of the + # Adaptive Network Hardening resource. + # @param body [AdaptiveNetworkHardeningEnforceRequest] + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_enforce(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, body, custom_headers:nil) + response = begin_enforce_async(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, body, custom_headers:custom_headers).value! + nil + end + + # + # Enforces the given rules on the NSG(s) listed in the request + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param adaptive_network_hardening_resource_name [String] The name of the + # Adaptive Network Hardening resource. + # @param body [AdaptiveNetworkHardeningEnforceRequest] + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_enforce_with_http_info(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, body, custom_headers:nil) + begin_enforce_async(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, body, custom_headers:custom_headers).value! + end + + # + # Enforces the given rules on the NSG(s) listed in the request + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param adaptive_network_hardening_resource_name [String] The name of the + # Adaptive Network Hardening resource. + # @param body [AdaptiveNetworkHardeningEnforceRequest] + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_enforce_async(resource_group_name, resource_namespace, resource_type, resource_name, adaptive_network_hardening_resource_name, body, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'resource_namespace is nil' if resource_namespace.nil? + fail ArgumentError, 'resource_type is nil' if resource_type.nil? + fail ArgumentError, 'resource_name is nil' if resource_name.nil? + fail ArgumentError, 'adaptive_network_hardening_resource_name is nil' if adaptive_network_hardening_resource_name.nil? + adaptive_network_hardening_enforce_action = 'enforce' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'body is nil' if body.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardeningEnforceRequest.mapper() + request_content = @client.serialize(request_mapper, body) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceNamespace' => resource_namespace,'resourceType' => resource_type,'resourceName' => resource_name,'adaptiveNetworkHardeningResourceName' => adaptive_network_hardening_resource_name,'adaptiveNetworkHardeningEnforceAction' => adaptive_network_hardening_enforce_action}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Gets a list of Adaptive Network Hardenings resources in scope of an extended + # resource. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AdaptiveNetworkHardeningsList] operation results. + # + def list_by_extended_resource_next(next_page_link, custom_headers:nil) + response = list_by_extended_resource_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a list of Adaptive Network Hardenings resources in scope of an extended + # resource. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_extended_resource_next_with_http_info(next_page_link, custom_headers:nil) + list_by_extended_resource_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Gets a list of Adaptive Network Hardenings resources in scope of an extended + # resource. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_extended_resource_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardeningsList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list of Adaptive Network Hardenings resources in scope of an extended + # resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AdaptiveNetworkHardeningsList] which provide lazy access to pages of + # the response. + # + def list_by_extended_resource_as_lazy(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + response = list_by_extended_resource_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_extended_resource_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/allowed_connections.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/allowed_connections.rb new file mode 100644 index 000000000..55bdfb734 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/allowed_connections.rb @@ -0,0 +1,535 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class AllowedConnections + include MsRestAzure + + # + # Creates and initializes a new instance of the AllowedConnections class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # Gets the list of all possible traffic between resources for the subscription + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers:nil) + first_page = list_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Gets the list of all possible traffic between resources for the subscription + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Gets the list of all possible traffic between resources for the subscription + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the list of all possible traffic between resources for the subscription + # and location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_home_region(custom_headers:nil) + first_page = list_by_home_region_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Gets the list of all possible traffic between resources for the subscription + # and location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_home_region_with_http_info(custom_headers:nil) + list_by_home_region_async(custom_headers:custom_headers).value! + end + + # + # Gets the list of all possible traffic between resources for the subscription + # and location. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_home_region_async(custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the list of all possible traffic between resources for the subscription + # and location, based on connection type. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param connection_type [ConnectionType] The type of allowed connections + # (Internal, External). Possible values include: 'Internal', 'External' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AllowedConnectionsResource] operation results. + # + def get(resource_group_name, connection_type, custom_headers:nil) + response = get_async(resource_group_name, connection_type, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the list of all possible traffic between resources for the subscription + # and location, based on connection type. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param connection_type [ConnectionType] The type of allowed connections + # (Internal, External). Possible values include: 'Internal', 'External' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, connection_type, custom_headers:nil) + get_async(resource_group_name, connection_type, custom_headers:custom_headers).value! + end + + # + # Gets the list of all possible traffic between resources for the subscription + # and location, based on connection type. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param connection_type [ConnectionType] The type of allowed connections + # (Internal, External). Possible values include: 'Internal', 'External' + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, connection_type, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, 'connection_type is nil' if connection_type.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location,'connectionType' => connection_type}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsResource.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the list of all possible traffic between resources for the subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AllowedConnectionsList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the list of all possible traffic between resources for the subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Gets the list of all possible traffic between resources for the subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the list of all possible traffic between resources for the subscription + # and location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AllowedConnectionsList] operation results. + # + def list_by_home_region_next(next_page_link, custom_headers:nil) + response = list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the list of all possible traffic between resources for the subscription + # and location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_home_region_next_with_http_info(next_page_link, custom_headers:nil) + list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Gets the list of all possible traffic between resources for the subscription + # and location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_home_region_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the list of all possible traffic between resources for the subscription + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AllowedConnectionsList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # Gets the list of all possible traffic between resources for the subscription + # and location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [AllowedConnectionsList] which provide lazy access to pages of the + # response. + # + def list_by_home_region_as_lazy(custom_headers:nil) + response = list_by_home_region_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_home_region_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/assessments.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/assessments.rb new file mode 100644 index 000000000..44c5f28c0 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/assessments.rb @@ -0,0 +1,555 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class Assessments + include MsRestAzure + + # + # Creates and initializes a new instance of the Assessments class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # Get security assessments on all your scanned resources inside a scope + # + # @param scope [String] Scope of the query, can be subscription + # (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + # (/providers/Microsoft.Management/managementGroups/mgName). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(scope, custom_headers:nil) + first_page = list_as_lazy(scope, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Get security assessments on all your scanned resources inside a scope + # + # @param scope [String] Scope of the query, can be subscription + # (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + # (/providers/Microsoft.Management/managementGroups/mgName). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(scope, custom_headers:nil) + list_async(scope, custom_headers:custom_headers).value! + end + + # + # Get security assessments on all your scanned resources inside a scope + # + # @param scope [String] Scope of the query, can be subscription + # (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + # (/providers/Microsoft.Management/managementGroups/mgName). + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(scope, custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'scope is nil' if scope.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{scope}/providers/Microsoft.Security/assessments' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'scope' => scope}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a security assessment on your scanned resource + # + # @param resource_id [String] The identifier of the resource. + # @param assessment_name [String] The Assessment Key - Unique key for the + # assessment type + # @param expand [ExpandEnum] OData expand. Optional. Possible values include: + # 'links', 'metadata' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecurityAssessment] operation results. + # + def get(resource_id, assessment_name, expand:nil, custom_headers:nil) + response = get_async(resource_id, assessment_name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a security assessment on your scanned resource + # + # @param resource_id [String] The identifier of the resource. + # @param assessment_name [String] The Assessment Key - Unique key for the + # assessment type + # @param expand [ExpandEnum] OData expand. Optional. Possible values include: + # 'links', 'metadata' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_id, assessment_name, expand:nil, custom_headers:nil) + get_async(resource_id, assessment_name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get a security assessment on your scanned resource + # + # @param resource_id [String] The identifier of the resource. + # @param assessment_name [String] The Assessment Key - Unique key for the + # assessment type + # @param expand [ExpandEnum] OData expand. Optional. Possible values include: + # 'links', 'metadata' + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_id, assessment_name, expand:nil, custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_id is nil' if resource_id.nil? + fail ArgumentError, 'assessment_name is nil' if assessment_name.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'assessmentName' => assessment_name}, + skip_encoding_path_params: {'resourceId' => resource_id}, + query_params: {'api-version' => @client.api_version,'$expand' => expand}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessment.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create a security assessment on your resource. An assessment metadata that + # describes this assessment must be predefined with the same name before + # inserting the assessment result + # + # @param resource_id [String] The identifier of the resource. + # @param assessment_name [String] The Assessment Key - Unique key for the + # assessment type + # @param assessment [SecurityAssessment] Calculated assessment on a pre-defined + # assessment metadata + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecurityAssessment] operation results. + # + def create_or_update(resource_id, assessment_name, assessment, custom_headers:nil) + response = create_or_update_async(resource_id, assessment_name, assessment, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create a security assessment on your resource. An assessment metadata that + # describes this assessment must be predefined with the same name before + # inserting the assessment result + # + # @param resource_id [String] The identifier of the resource. + # @param assessment_name [String] The Assessment Key - Unique key for the + # assessment type + # @param assessment [SecurityAssessment] Calculated assessment on a pre-defined + # assessment metadata + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def create_or_update_with_http_info(resource_id, assessment_name, assessment, custom_headers:nil) + create_or_update_async(resource_id, assessment_name, assessment, custom_headers:custom_headers).value! + end + + # + # Create a security assessment on your resource. An assessment metadata that + # describes this assessment must be predefined with the same name before + # inserting the assessment result + # + # @param resource_id [String] The identifier of the resource. + # @param assessment_name [String] The Assessment Key - Unique key for the + # assessment type + # @param assessment [SecurityAssessment] Calculated assessment on a pre-defined + # assessment metadata + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def create_or_update_async(resource_id, assessment_name, assessment, custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_id is nil' if resource_id.nil? + fail ArgumentError, 'assessment_name is nil' if assessment_name.nil? + fail ArgumentError, 'assessment is nil' if assessment.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessment.mapper() + request_content = @client.serialize(request_mapper, assessment) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = '{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'assessmentName' => assessment_name}, + skip_encoding_path_params: {'resourceId' => resource_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessment.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessment.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete a security assessment on your resource. An assessment metadata that + # describes this assessment must be predefined with the same name before + # inserting the assessment result + # + # @param resource_id [String] The identifier of the resource. + # @param assessment_name [String] The Assessment Key - Unique key for the + # assessment type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_id, assessment_name, custom_headers:nil) + response = delete_async(resource_id, assessment_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete a security assessment on your resource. An assessment metadata that + # describes this assessment must be predefined with the same name before + # inserting the assessment result + # + # @param resource_id [String] The identifier of the resource. + # @param assessment_name [String] The Assessment Key - Unique key for the + # assessment type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def delete_with_http_info(resource_id, assessment_name, custom_headers:nil) + delete_async(resource_id, assessment_name, custom_headers:custom_headers).value! + end + + # + # Delete a security assessment on your resource. An assessment metadata that + # describes this assessment must be predefined with the same name before + # inserting the assessment result + # + # @param resource_id [String] The identifier of the resource. + # @param assessment_name [String] The Assessment Key - Unique key for the + # assessment type + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def delete_async(resource_id, assessment_name, custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_id is nil' if resource_id.nil? + fail ArgumentError, 'assessment_name is nil' if assessment_name.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'assessmentName' => assessment_name}, + skip_encoding_path_params: {'resourceId' => resource_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Get security assessments on all your scanned resources inside a scope + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecurityAssessmentList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get security assessments on all your scanned resources inside a scope + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Get security assessments on all your scanned resources inside a scope + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get security assessments on all your scanned resources inside a scope + # + # @param scope [String] Scope of the query, can be subscription + # (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + # (/providers/Microsoft.Management/managementGroups/mgName). + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecurityAssessmentList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(scope, custom_headers:nil) + response = list_async(scope, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/assessments_metadata.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/assessments_metadata.rb new file mode 100644 index 000000000..cd2b64a38 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/assessments_metadata.rb @@ -0,0 +1,799 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class AssessmentsMetadata + include MsRestAzure + + # + # Creates and initializes a new instance of the AssessmentsMetadata class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # Get metadata information on all assessment types + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers:nil) + first_page = list_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Get metadata information on all assessment types + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Get metadata information on all assessment types + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.Security/assessmentMetadata' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get metadata information on an assessment type + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecurityAssessmentMetadata] operation results. + # + def get(assessment_metadata_name, custom_headers:nil) + response = get_async(assessment_metadata_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get metadata information on an assessment type + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(assessment_metadata_name, custom_headers:nil) + get_async(assessment_metadata_name, custom_headers:custom_headers).value! + end + + # + # Get metadata information on an assessment type + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(assessment_metadata_name, custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'assessment_metadata_name is nil' if assessment_metadata_name.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'assessmentMetadataName' => assessment_metadata_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadata.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get metadata information on all assessment types in a specific subscription + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_subscription(custom_headers:nil) + first_page = list_by_subscription_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Get metadata information on all assessment types in a specific subscription + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_with_http_info(custom_headers:nil) + list_by_subscription_async(custom_headers:custom_headers).value! + end + + # + # Get metadata information on all assessment types in a specific subscription + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get metadata information on an assessment type in a specific subscription + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecurityAssessmentMetadata] operation results. + # + def get_in_subscription(assessment_metadata_name, custom_headers:nil) + response = get_in_subscription_async(assessment_metadata_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get metadata information on an assessment type in a specific subscription + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_in_subscription_with_http_info(assessment_metadata_name, custom_headers:nil) + get_in_subscription_async(assessment_metadata_name, custom_headers:custom_headers).value! + end + + # + # Get metadata information on an assessment type in a specific subscription + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_in_subscription_async(assessment_metadata_name, custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'assessment_metadata_name is nil' if assessment_metadata_name.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'assessmentMetadataName' => assessment_metadata_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadata.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create metadata information on an assessment type in a specific subscription + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param assessment_metadata [SecurityAssessmentMetadata] AssessmentMetadata + # object + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecurityAssessmentMetadata] operation results. + # + def create_in_subscription(assessment_metadata_name, assessment_metadata, custom_headers:nil) + response = create_in_subscription_async(assessment_metadata_name, assessment_metadata, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create metadata information on an assessment type in a specific subscription + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param assessment_metadata [SecurityAssessmentMetadata] AssessmentMetadata + # object + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def create_in_subscription_with_http_info(assessment_metadata_name, assessment_metadata, custom_headers:nil) + create_in_subscription_async(assessment_metadata_name, assessment_metadata, custom_headers:custom_headers).value! + end + + # + # Create metadata information on an assessment type in a specific subscription + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param assessment_metadata [SecurityAssessmentMetadata] AssessmentMetadata + # object + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def create_in_subscription_async(assessment_metadata_name, assessment_metadata, custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'assessment_metadata_name is nil' if assessment_metadata_name.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'assessment_metadata is nil' if assessment_metadata.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadata.mapper() + request_content = @client.serialize(request_mapper, assessment_metadata) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'assessmentMetadataName' => assessment_metadata_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadata.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete metadata information on an assessment type in a specific subscription, + # will cause the deletion of all the assessments of that type in that + # subscription + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete_in_subscription(assessment_metadata_name, custom_headers:nil) + response = delete_in_subscription_async(assessment_metadata_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete metadata information on an assessment type in a specific subscription, + # will cause the deletion of all the assessments of that type in that + # subscription + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def delete_in_subscription_with_http_info(assessment_metadata_name, custom_headers:nil) + delete_in_subscription_async(assessment_metadata_name, custom_headers:custom_headers).value! + end + + # + # Delete metadata information on an assessment type in a specific subscription, + # will cause the deletion of all the assessments of that type in that + # subscription + # + # @param assessment_metadata_name [String] The Assessment Key - Unique key for + # the assessment type + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def delete_in_subscription_async(assessment_metadata_name, custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'assessment_metadata_name is nil' if assessment_metadata_name.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'assessmentMetadataName' => assessment_metadata_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Get metadata information on all assessment types + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecurityAssessmentMetadataList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get metadata information on all assessment types + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Get metadata information on all assessment types + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get metadata information on all assessment types in a specific subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecurityAssessmentMetadataList] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers:nil) + response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get metadata information on all assessment types in a specific subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil) + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Get metadata information on all assessment types in a specific subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get metadata information on all assessment types + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecurityAssessmentMetadataList] which provide lazy access to pages + # of the response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # Get metadata information on all assessment types in a specific subscription + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecurityAssessmentMetadataList] which provide lazy access to pages + # of the response. + # + def list_by_subscription_as_lazy(custom_headers:nil) + response = list_by_subscription_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/discovered_security_solutions.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/discovered_security_solutions.rb new file mode 100644 index 000000000..9defeeb0a --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/discovered_security_solutions.rb @@ -0,0 +1,532 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class DiscoveredSecuritySolutions + include MsRestAzure + + # + # Creates and initializes a new instance of the DiscoveredSecuritySolutions class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # Gets a list of discovered Security Solutions for the subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers:nil) + first_page = list_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Gets a list of discovered Security Solutions for the subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Gets a list of discovered Security Solutions for the subscription. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolutionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list of discovered Security Solutions for the subscription and + # location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_home_region(custom_headers:nil) + first_page = list_by_home_region_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Gets a list of discovered Security Solutions for the subscription and + # location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_home_region_with_http_info(custom_headers:nil) + list_by_home_region_async(custom_headers:custom_headers).value! + end + + # + # Gets a list of discovered Security Solutions for the subscription and + # location. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_home_region_async(custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolutionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a specific discovered Security Solution. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param discovered_security_solution_name [String] Name of a discovered + # security solution. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiscoveredSecuritySolution] operation results. + # + def get(resource_group_name, discovered_security_solution_name, custom_headers:nil) + response = get_async(resource_group_name, discovered_security_solution_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a specific discovered Security Solution. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param discovered_security_solution_name [String] Name of a discovered + # security solution. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, discovered_security_solution_name, custom_headers:nil) + get_async(resource_group_name, discovered_security_solution_name, custom_headers:custom_headers).value! + end + + # + # Gets a specific discovered Security Solution. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param discovered_security_solution_name [String] Name of a discovered + # security solution. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, discovered_security_solution_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, 'discovered_security_solution_name is nil' if discovered_security_solution_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location,'discoveredSecuritySolutionName' => discovered_security_solution_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolution.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list of discovered Security Solutions for the subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiscoveredSecuritySolutionList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a list of discovered Security Solutions for the subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Gets a list of discovered Security Solutions for the subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolutionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list of discovered Security Solutions for the subscription and + # location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiscoveredSecuritySolutionList] operation results. + # + def list_by_home_region_next(next_page_link, custom_headers:nil) + response = list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a list of discovered Security Solutions for the subscription and + # location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_home_region_next_with_http_info(next_page_link, custom_headers:nil) + list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Gets a list of discovered Security Solutions for the subscription and + # location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_home_region_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolutionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list of discovered Security Solutions for the subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiscoveredSecuritySolutionList] which provide lazy access to pages + # of the response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # Gets a list of discovered Security Solutions for the subscription and + # location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiscoveredSecuritySolutionList] which provide lazy access to pages + # of the response. + # + def list_by_home_region_as_lazy(custom_headers:nil) + response = list_by_home_region_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_home_region_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/external_security_solutions.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/external_security_solutions.rb new file mode 100644 index 000000000..191d6e0a3 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/external_security_solutions.rb @@ -0,0 +1,525 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class ExternalSecuritySolutions + include MsRestAzure + + # + # Creates and initializes a new instance of the ExternalSecuritySolutions class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # Gets a list of external security solutions for the subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers:nil) + first_page = list_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Gets a list of external security solutions for the subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Gets a list of external security solutions for the subscription. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list of external Security Solutions for the subscription and location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_home_region(custom_headers:nil) + first_page = list_by_home_region_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Gets a list of external Security Solutions for the subscription and location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_home_region_with_http_info(custom_headers:nil) + list_by_home_region_async(custom_headers:custom_headers).value! + end + + # + # Gets a list of external Security Solutions for the subscription and location. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_home_region_async(custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a specific external Security Solution. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param external_security_solutions_name [String] Name of an external security + # solution. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ExternalSecuritySolution] operation results. + # + def get(resource_group_name, external_security_solutions_name, custom_headers:nil) + response = get_async(resource_group_name, external_security_solutions_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a specific external Security Solution. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param external_security_solutions_name [String] Name of an external security + # solution. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, external_security_solutions_name, custom_headers:nil) + get_async(resource_group_name, external_security_solutions_name, custom_headers:custom_headers).value! + end + + # + # Gets a specific external Security Solution. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param external_security_solutions_name [String] Name of an external security + # solution. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, external_security_solutions_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, 'external_security_solutions_name is nil' if external_security_solutions_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location,'externalSecuritySolutionsName' => external_security_solutions_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolution.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list of external security solutions for the subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ExternalSecuritySolutionList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a list of external security solutions for the subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Gets a list of external security solutions for the subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list of external Security Solutions for the subscription and location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ExternalSecuritySolutionList] operation results. + # + def list_by_home_region_next(next_page_link, custom_headers:nil) + response = list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a list of external Security Solutions for the subscription and location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_home_region_next_with_http_info(next_page_link, custom_headers:nil) + list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Gets a list of external Security Solutions for the subscription and location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_home_region_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list of external security solutions for the subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ExternalSecuritySolutionList] which provide lazy access to pages of + # the response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # Gets a list of external Security Solutions for the subscription and location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ExternalSecuritySolutionList] which provide lazy access to pages of + # the response. + # + def list_by_home_region_as_lazy(custom_headers:nil) + response = list_by_home_region_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_home_region_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/jit_network_access_policies.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/jit_network_access_policies.rb new file mode 100644 index 000000000..e85d130aa --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/jit_network_access_policies.rb @@ -0,0 +1,1295 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class JitNetworkAccessPolicies + include MsRestAzure + + # + # Creates and initializes a new instance of the JitNetworkAccessPolicies class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # Policies for protecting resources using Just-in-Time access control. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers:nil) + first_page = list_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Policies for protecting resources using Just-in-Time access control. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Policies for protecting resources using Just-in-Time access control. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_region(custom_headers:nil) + first_page = list_by_region_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_region_with_http_info(custom_headers:nil) + list_by_region_async(custom_headers:custom_headers).value! + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_region_async(custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource_group(resource_group_name, custom_headers:nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil) + list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource_group_and_region(resource_group_name, custom_headers:nil) + first_page = list_by_resource_group_and_region_as_lazy(resource_group_name, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_and_region_with_http_info(resource_group_name, custom_headers:nil) + list_by_resource_group_and_region_async(resource_group_name, custom_headers:custom_headers).value! + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_and_region_async(resource_group_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [JitNetworkAccessPolicy] operation results. + # + def get(resource_group_name, jit_network_access_policy_name, custom_headers:nil) + response = get_async(resource_group_name, jit_network_access_policy_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, jit_network_access_policy_name, custom_headers:nil) + get_async(resource_group_name, jit_network_access_policy_name, custom_headers:custom_headers).value! + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, jit_network_access_policy_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, 'jit_network_access_policy_name is nil' if jit_network_access_policy_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location,'jitNetworkAccessPolicyName' => jit_network_access_policy_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicy.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create a policy for protecting resources using Just-in-Time access control + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param body [JitNetworkAccessPolicy] + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [JitNetworkAccessPolicy] operation results. + # + def create_or_update(resource_group_name, jit_network_access_policy_name, body, custom_headers:nil) + response = create_or_update_async(resource_group_name, jit_network_access_policy_name, body, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create a policy for protecting resources using Just-in-Time access control + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param body [JitNetworkAccessPolicy] + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def create_or_update_with_http_info(resource_group_name, jit_network_access_policy_name, body, custom_headers:nil) + create_or_update_async(resource_group_name, jit_network_access_policy_name, body, custom_headers:custom_headers).value! + end + + # + # Create a policy for protecting resources using Just-in-Time access control + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param body [JitNetworkAccessPolicy] + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def create_or_update_async(resource_group_name, jit_network_access_policy_name, body, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, 'jit_network_access_policy_name is nil' if jit_network_access_policy_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'body is nil' if body.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicy.mapper() + request_content = @client.serialize(request_mapper, body) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location,'jitNetworkAccessPolicyName' => jit_network_access_policy_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicy.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete a Just-in-Time access control policy. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, jit_network_access_policy_name, custom_headers:nil) + response = delete_async(resource_group_name, jit_network_access_policy_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete a Just-in-Time access control policy. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def delete_with_http_info(resource_group_name, jit_network_access_policy_name, custom_headers:nil) + delete_async(resource_group_name, jit_network_access_policy_name, custom_headers:custom_headers).value! + end + + # + # Delete a Just-in-Time access control policy. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def delete_async(resource_group_name, jit_network_access_policy_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, 'jit_network_access_policy_name is nil' if jit_network_access_policy_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location,'jitNetworkAccessPolicyName' => jit_network_access_policy_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Initiate a JIT access from a specific Just-in-Time policy configuration. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param body [JitNetworkAccessPolicyInitiateRequest] + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [JitNetworkAccessRequest] operation results. + # + def initiate(resource_group_name, jit_network_access_policy_name, body, custom_headers:nil) + response = initiate_async(resource_group_name, jit_network_access_policy_name, body, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Initiate a JIT access from a specific Just-in-Time policy configuration. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param body [JitNetworkAccessPolicyInitiateRequest] + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def initiate_with_http_info(resource_group_name, jit_network_access_policy_name, body, custom_headers:nil) + initiate_async(resource_group_name, jit_network_access_policy_name, body, custom_headers:custom_headers).value! + end + + # + # Initiate a JIT access from a specific Just-in-Time policy configuration. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param jit_network_access_policy_name [String] Name of a Just-in-Time access + # configuration policy. + # @param body [JitNetworkAccessPolicyInitiateRequest] + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def initiate_async(resource_group_name, jit_network_access_policy_name, body, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, 'jit_network_access_policy_name is nil' if jit_network_access_policy_name.nil? + jit_network_access_policy_initiate_type = 'initiate' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'body is nil' if body.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiateRequest.mapper() + request_content = @client.serialize(request_mapper, body) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location,'jitNetworkAccessPolicyName' => jit_network_access_policy_name,'jitNetworkAccessPolicyInitiateType' => jit_network_access_policy_initiate_type}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 202 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequest.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Policies for protecting resources using Just-in-Time access control. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [JitNetworkAccessPoliciesList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Policies for protecting resources using Just-in-Time access control. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Policies for protecting resources using Just-in-Time access control. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [JitNetworkAccessPoliciesList] operation results. + # + def list_by_region_next(next_page_link, custom_headers:nil) + response = list_by_region_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_region_next_with_http_info(next_page_link, custom_headers:nil) + list_by_region_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_region_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [JitNetworkAccessPoliciesList] operation results. + # + def list_by_resource_group_next(next_page_link, custom_headers:nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil) + list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [JitNetworkAccessPoliciesList] operation results. + # + def list_by_resource_group_and_region_next(next_page_link, custom_headers:nil) + response = list_by_resource_group_and_region_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_and_region_next_with_http_info(next_page_link, custom_headers:nil) + list_by_resource_group_and_region_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_and_region_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Policies for protecting resources using Just-in-Time access control. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [JitNetworkAccessPoliciesList] which provide lazy access to pages of + # the response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [JitNetworkAccessPoliciesList] which provide lazy access to pages of + # the response. + # + def list_by_region_as_lazy(custom_headers:nil) + response = list_by_region_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_region_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [JitNetworkAccessPoliciesList] which provide lazy access to pages of + # the response. + # + def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil) + response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # Policies for protecting resources using Just-in-Time access control for the + # subscription, location + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [JitNetworkAccessPoliciesList] which provide lazy access to pages of + # the response. + # + def list_by_resource_group_and_region_as_lazy(resource_group_name, custom_headers:nil) + response = list_by_resource_group_and_region_async(resource_group_name, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_group_and_region_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state.rb new file mode 100644 index 000000000..7b2530203 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for AadConnectivityState + # + module AadConnectivityState + Discovered = "Discovered" + NotLicensed = "NotLicensed" + Connected = "Connected" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state1.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state1.rb new file mode 100644 index 000000000..d003f621a --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state1.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes an Azure resource with kind + # + class AadConnectivityState1 + + include MsRestAzure + + # @return [AadConnectivityState] The connectivity state of the external + # AAD solution . Possible values include: 'Discovered', 'NotLicensed', + # 'Connected' + attr_accessor :connectivity_state + + + # + # Mapper for AadConnectivityState1 class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AadConnectivityState', + type: { + name: 'Composite', + class_name: 'AadConnectivityState1', + model_properties: { + connectivity_state: { + client_side_validation: true, + required: false, + serialized_name: 'connectivityState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_external_security_solution.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_external_security_solution.rb new file mode 100644 index 000000000..abdf0b5a2 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_external_security_solution.rb @@ -0,0 +1,99 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Represents an AAD identity protection solution which sends logs to an OMS + # workspace. + # + class AadExternalSecuritySolution < ExternalSecuritySolution + + include MsRestAzure + + + def initialize + @kind = "AAD" + end + + attr_accessor :kind + + # @return [AadSolutionProperties] + attr_accessor :properties + + + # + # Mapper for AadExternalSecuritySolution class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AAD', + type: { + name: 'Composite', + class_name: 'AadExternalSecuritySolution', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + kind: { + client_side_validation: true, + required: true, + serialized_name: 'kind', + type: { + name: 'String' + } + }, + properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties', + type: { + name: 'Composite', + class_name: 'AadSolutionProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_solution_properties.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_solution_properties.rb new file mode 100644 index 000000000..b44409f74 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/aad_solution_properties.rb @@ -0,0 +1,83 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # The external security solution properties for AAD solutions + # + # + class AadSolutionProperties + + include MsRestAzure + + # @return [String] + attr_accessor :device_vendor + + # @return [String] + attr_accessor :device_type + + # @return [ConnectedWorkspace] + attr_accessor :workspace + + # @return [AadConnectivityState] The connectivity state of the external + # AAD solution . Possible values include: 'Discovered', 'NotLicensed', + # 'Connected' + attr_accessor :connectivity_state + + + # + # Mapper for AadSolutionProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AadSolutionProperties', + type: { + name: 'Composite', + class_name: 'AadSolutionProperties', + model_properties: { + device_vendor: { + client_side_validation: true, + required: false, + serialized_name: 'deviceVendor', + type: { + name: 'String' + } + }, + device_type: { + client_side_validation: true, + required: false, + serialized_name: 'deviceType', + type: { + name: 'String' + } + }, + workspace: { + client_side_validation: true, + required: false, + serialized_name: 'workspace', + type: { + name: 'Composite', + class_name: 'ConnectedWorkspace' + } + }, + connectivity_state: { + client_side_validation: true, + required: false, + serialized_name: 'connectivityState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening.rb new file mode 100644 index 000000000..5f6605623 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening.rb @@ -0,0 +1,116 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # The resource whose properties describes the Adaptive Network Hardening + # settings for some Azure resource + # + class AdaptiveNetworkHardening < Resource + + include MsRestAzure + + # @return [Array] The security rules which are recommended to be + # effective on the VM + attr_accessor :rules + + # @return [DateTime] The UTC time on which the rules were calculated + attr_accessor :rules_calculation_time + + # @return [Array] The Network Security + # Groups effective on the network interfaces of the protected resource + attr_accessor :effective_network_security_groups + + + # + # Mapper for AdaptiveNetworkHardening class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AdaptiveNetworkHardening', + type: { + name: 'Composite', + class_name: 'AdaptiveNetworkHardening', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.rules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'RuleElementType', + type: { + name: 'Composite', + class_name: 'Rule' + } + } + } + }, + rules_calculation_time: { + client_side_validation: true, + required: false, + serialized_name: 'properties.rulesCalculationTime', + type: { + name: 'DateTime' + } + }, + effective_network_security_groups: { + client_side_validation: true, + required: false, + serialized_name: 'properties.effectiveNetworkSecurityGroups', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EffectiveNetworkSecurityGroupsElementType', + type: { + name: 'Composite', + class_name: 'EffectiveNetworkSecurityGroups' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening_enforce_request.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening_enforce_request.rb new file mode 100644 index 000000000..2af9604a6 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening_enforce_request.rb @@ -0,0 +1,77 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class AdaptiveNetworkHardeningEnforceRequest + + include MsRestAzure + + # @return [Array] The rules to enforce + attr_accessor :rules + + # @return [Array] The Azure resource IDs of the effective network + # security groups that will be updated with the created security rules + # from the Adaptive Network Hardening rules + attr_accessor :network_security_groups + + + # + # Mapper for AdaptiveNetworkHardeningEnforceRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AdaptiveNetworkHardeningEnforceRequest', + type: { + name: 'Composite', + class_name: 'AdaptiveNetworkHardeningEnforceRequest', + model_properties: { + rules: { + client_side_validation: true, + required: true, + serialized_name: 'rules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'RuleElementType', + type: { + name: 'Composite', + class_name: 'Rule' + } + } + } + }, + network_security_groups: { + client_side_validation: true, + required: true, + serialized_name: 'networkSecurityGroups', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardenings_list.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardenings_list.rb new file mode 100644 index 000000000..da906f490 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardenings_list.rb @@ -0,0 +1,99 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Response for ListAdaptiveNetworkHardenings API service call + # + class AdaptiveNetworkHardeningsList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A list of Adaptive Network + # Hardenings resources + attr_accessor :value + + # @return [String] The URL to get the next set of results + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [AdaptiveNetworkHardeningsList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for AdaptiveNetworkHardeningsList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AdaptiveNetworkHardeningsList', + type: { + name: 'Composite', + class_name: 'AdaptiveNetworkHardeningsList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'AdaptiveNetworkHardeningElementType', + type: { + name: 'Composite', + class_name: 'AdaptiveNetworkHardening' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/allowed_connections_list.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/allowed_connections_list.rb new file mode 100644 index 000000000..f19dd44a0 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/allowed_connections_list.rb @@ -0,0 +1,100 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # List of all possible traffic between Azure resources + # + class AllowedConnectionsList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] + attr_accessor :value + + # @return [String] The URI to fetch the next page. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [AllowedConnectionsList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for AllowedConnectionsList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AllowedConnectionsList', + type: { + name: 'Composite', + class_name: 'AllowedConnectionsList', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'AllowedConnectionsResourceElementType', + type: { + name: 'Composite', + class_name: 'AllowedConnectionsResource' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/allowed_connections_resource.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/allowed_connections_resource.rb new file mode 100644 index 000000000..67343513f --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/allowed_connections_resource.rb @@ -0,0 +1,118 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # The resource whose properties describes the allowed traffic between Azure + # resources + # + class AllowedConnectionsResource + + include MsRestAzure + + # @return [String] Resource Id + attr_accessor :id + + # @return [String] Resource name + attr_accessor :name + + # @return [String] Resource type + attr_accessor :type + + # @return [String] Location where the resource is stored + attr_accessor :location + + # @return [DateTime] The UTC time on which the allowed connections + # resource was calculated + attr_accessor :calculated_date_time + + # @return [Array] List of connectable resources + attr_accessor :connectable_resources + + + # + # Mapper for AllowedConnectionsResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AllowedConnectionsResource', + type: { + name: 'Composite', + class_name: 'AllowedConnectionsResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + calculated_date_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.calculatedDateTime', + type: { + name: 'DateTime' + } + }, + connectable_resources: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.connectableResources', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ConnectableResourceElementType', + type: { + name: 'Composite', + class_name: 'ConnectableResource' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_group.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_group.rb new file mode 100644 index 000000000..ef2a8f66a --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_group.rb @@ -0,0 +1,207 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class AppWhitelistingGroup + + include MsRestAzure + + # @return [String] Resource Id + attr_accessor :id + + # @return [String] Resource name + attr_accessor :name + + # @return [String] Resource type + attr_accessor :type + + # @return [String] Location where the resource is stored + attr_accessor :location + + # @return [Enum] Possible values include: 'Audit', 'Enforce', 'None' + attr_accessor :enforcement_mode + + # @return [ProtectionMode] + attr_accessor :protection_mode + + # @return [Enum] Possible values include: 'Configured', 'NotConfigured', + # 'InProgress', 'Failed', 'NoStatus' + attr_accessor :configuration_status + + # @return [Enum] Possible values include: 'Recommended', + # 'NotRecommended', 'NotAvailable', 'NoStatus' + attr_accessor :recommendation_status + + # @return [Array] + attr_accessor :issues + + # @return [Enum] Possible values include: 'Azure_AppLocker', + # 'Azure_AuditD', 'NonAzure_AppLocker', 'NonAzure_AuditD', 'None' + attr_accessor :source_system + + # @return [Array] + attr_accessor :vm_recommendations + + # @return [Array] + attr_accessor :path_recommendations + + + # + # Mapper for AppWhitelistingGroup class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AppWhitelistingGroup', + type: { + name: 'Composite', + class_name: 'AppWhitelistingGroup', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + enforcement_mode: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enforcementMode', + type: { + name: 'String' + } + }, + protection_mode: { + client_side_validation: true, + required: false, + serialized_name: 'properties.protectionMode', + type: { + name: 'Composite', + class_name: 'ProtectionMode' + } + }, + configuration_status: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.configurationStatus', + type: { + name: 'String' + } + }, + recommendation_status: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.recommendationStatus', + type: { + name: 'String' + } + }, + issues: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.issues', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'AppWhitelistingIssueSummaryElementType', + type: { + name: 'Composite', + class_name: 'AppWhitelistingIssueSummary' + } + } + } + }, + source_system: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.sourceSystem', + type: { + name: 'String' + } + }, + vm_recommendations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.vmRecommendations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'VmRecommendationElementType', + type: { + name: 'Composite', + class_name: 'VmRecommendation' + } + } + } + }, + path_recommendations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.pathRecommendations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PathRecommendationElementType', + type: { + name: 'Composite', + class_name: 'PathRecommendation' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_groups.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_groups.rb new file mode 100644 index 000000000..98b125649 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_groups.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Represents a list of VM/server groups and set of rules that are + # Recommended by Azure Security Center to be allowed + # + class AppWhitelistingGroups + + include MsRestAzure + + # @return [Array] + attr_accessor :value + + + # + # Mapper for AppWhitelistingGroups class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AppWhitelistingGroups', + type: { + name: 'Composite', + class_name: 'AppWhitelistingGroups', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'AppWhitelistingGroupElementType', + type: { + name: 'Composite', + class_name: 'AppWhitelistingGroup' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_issue_summary.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_issue_summary.rb new file mode 100644 index 000000000..f12c9af25 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_issue_summary.rb @@ -0,0 +1,61 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Represents a summary of the alerts of the VM/server group + # + class AppWhitelistingIssueSummary + + include MsRestAzure + + # @return [Enum] Possible values include: 'ViolationsAudited', + # 'ViolationsBlocked', 'MsiAndScriptViolationsAudited', + # 'MsiAndScriptViolationsBlocked', 'ExecutableViolationsAudited', + # 'RulesViolatedManually' + attr_accessor :issue + + # @return [Float] The number of machines in the VM/server group that have + # this alert + attr_accessor :number_of_vms + + + # + # Mapper for AppWhitelistingIssueSummary class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AppWhitelistingIssueSummary', + type: { + name: 'Composite', + class_name: 'AppWhitelistingIssueSummary', + model_properties: { + issue: { + client_side_validation: true, + required: false, + serialized_name: 'issue', + type: { + name: 'String' + } + }, + number_of_vms: { + client_side_validation: true, + required: false, + serialized_name: 'numberOfVms', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/asc_location.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/asc_location.rb new file mode 100644 index 000000000..c34433309 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/asc_location.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # The ASC location of the subscription is in the "name" field + # + class AscLocation < Resource + + include MsRestAzure + + # @return + attr_accessor :properties + + + # + # Mapper for AscLocation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AscLocation', + type: { + name: 'Composite', + class_name: 'AscLocation', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_links.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_links.rb new file mode 100644 index 000000000..efc573eb2 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_links.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Links relevant to the assessment + # + class AssessmentLinks + + include MsRestAzure + + # @return [String] Link to assessment in Azure Portal + attr_accessor :azure_portal_uri + + + # + # Mapper for AssessmentLinks class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AssessmentLinks', + type: { + name: 'Composite', + class_name: 'AssessmentLinks', + model_properties: { + azure_portal_uri: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'azurePortalUri', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_status.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_status.rb new file mode 100644 index 000000000..db8b91171 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_status.rb @@ -0,0 +1,71 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # The result of the assessment + # + class AssessmentStatus + + include MsRestAzure + + # @return [AssessmentStatusCode] Programmatic code for the status of the + # assessment. Possible values include: 'Healthy', 'Unhealthy', + # 'NotApplicable' + attr_accessor :code + + # @return [String] Programmatic code for the cause of the assessment + # status + attr_accessor :cause + + # @return [String] Human readable description of the assessment status + attr_accessor :description + + + # + # Mapper for AssessmentStatus class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AssessmentStatus', + type: { + name: 'Composite', + class_name: 'AssessmentStatus', + model_properties: { + code: { + client_side_validation: true, + required: true, + serialized_name: 'code', + type: { + name: 'String' + } + }, + cause: { + client_side_validation: true, + required: false, + serialized_name: 'cause', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_status_code.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_status_code.rb new file mode 100644 index 000000000..b22a2cd78 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_status_code.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for AssessmentStatusCode + # + module AssessmentStatusCode + Healthy = "Healthy" + Unhealthy = "Unhealthy" + NotApplicable = "NotApplicable" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_type.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_type.rb new file mode 100644 index 000000000..f89ce2b59 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_type.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for AssessmentType + # + module AssessmentType + BuiltIn = "BuiltIn" + CustomPolicy = "CustomPolicy" + CustomerManaged = "CustomerManaged" + VerifiedPartner = "VerifiedPartner" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/ata_external_security_solution.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/ata_external_security_solution.rb new file mode 100644 index 000000000..a8140e785 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/ata_external_security_solution.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Represents an ATA security solution which sends logs to an OMS workspace + # + class AtaExternalSecuritySolution < ExternalSecuritySolution + + include MsRestAzure + + + def initialize + @kind = "ATA" + end + + attr_accessor :kind + + # @return [AtaSolutionProperties] + attr_accessor :properties + + + # + # Mapper for AtaExternalSecuritySolution class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ATA', + type: { + name: 'Composite', + class_name: 'AtaExternalSecuritySolution', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + kind: { + client_side_validation: true, + required: true, + serialized_name: 'kind', + type: { + name: 'String' + } + }, + properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties', + type: { + name: 'Composite', + class_name: 'AtaSolutionProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/ata_solution_properties.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/ata_solution_properties.rb new file mode 100644 index 000000000..9b9f017f3 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/ata_solution_properties.rb @@ -0,0 +1,87 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # The external security solution properties for ATA solutions + # + # + class AtaSolutionProperties < ExternalSecuritySolutionProperties + + include MsRestAzure + + # @return [String] + attr_accessor :last_event_received + + + # + # Mapper for AtaSolutionProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AtaSolutionProperties', + type: { + name: 'Composite', + class_name: 'AtaSolutionProperties', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + device_vendor: { + client_side_validation: true, + required: false, + serialized_name: 'deviceVendor', + type: { + name: 'String' + } + }, + device_type: { + client_side_validation: true, + required: false, + serialized_name: 'deviceType', + type: { + name: 'String' + } + }, + workspace: { + client_side_validation: true, + required: false, + serialized_name: 'workspace', + type: { + name: 'Composite', + class_name: 'ConnectedWorkspace' + } + }, + last_event_received: { + client_side_validation: true, + required: false, + serialized_name: 'lastEventReceived', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/azure_resource_details.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/azure_resource_details.rb new file mode 100644 index 000000000..80236e99a --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/azure_resource_details.rb @@ -0,0 +1,62 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Details of the Azure resource that was assessed + # + class AzureResourceDetails < ResourceDetails + + include MsRestAzure + + + def initialize + @source = "Azure" + end + + attr_accessor :source + + # @return [String] Azure resource Id of the assessed resource + attr_accessor :id + + + # + # Mapper for AzureResourceDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Azure', + type: { + name: 'Composite', + class_name: 'AzureResourceDetails', + model_properties: { + source: { + client_side_validation: true, + required: true, + serialized_name: 'source', + type: { + name: 'String' + } + }, + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/category.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/category.rb new file mode 100644 index 000000000..a7a6e9198 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/category.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for Category + # + module Category + Compute = "Compute" + Networking = "Networking" + Data = "Data" + IdentityAndAccess = "IdentityAndAccess" + IoT = "IoT" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/cef_external_security_solution.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/cef_external_security_solution.rb new file mode 100644 index 000000000..686dfa6e3 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/cef_external_security_solution.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Represents a security solution which sends CEF logs to an OMS workspace + # + class CefExternalSecuritySolution < ExternalSecuritySolution + + include MsRestAzure + + + def initialize + @kind = "CEF" + end + + attr_accessor :kind + + # @return [CefSolutionProperties] + attr_accessor :properties + + + # + # Mapper for CefExternalSecuritySolution class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CEF', + type: { + name: 'Composite', + class_name: 'CefExternalSecuritySolution', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + kind: { + client_side_validation: true, + required: true, + serialized_name: 'kind', + type: { + name: 'String' + } + }, + properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties', + type: { + name: 'Composite', + class_name: 'CefSolutionProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/cef_solution_properties.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/cef_solution_properties.rb new file mode 100644 index 000000000..665a92489 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/cef_solution_properties.rb @@ -0,0 +1,109 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # The external security solution properties for CEF solutions + # + # + class CefSolutionProperties < ExternalSecuritySolutionProperties + + include MsRestAzure + + # @return [String] + attr_accessor :hostname + + # @return [String] + attr_accessor :agent + + # @return [String] + attr_accessor :last_event_received + + + # + # Mapper for CefSolutionProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CefSolutionProperties', + type: { + name: 'Composite', + class_name: 'CefSolutionProperties', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + device_vendor: { + client_side_validation: true, + required: false, + serialized_name: 'deviceVendor', + type: { + name: 'String' + } + }, + device_type: { + client_side_validation: true, + required: false, + serialized_name: 'deviceType', + type: { + name: 'String' + } + }, + workspace: { + client_side_validation: true, + required: false, + serialized_name: 'workspace', + type: { + name: 'Composite', + class_name: 'ConnectedWorkspace' + } + }, + hostname: { + client_side_validation: true, + required: false, + serialized_name: 'hostname', + type: { + name: 'String' + } + }, + agent: { + client_side_validation: true, + required: false, + serialized_name: 'agent', + type: { + name: 'String' + } + }, + last_event_received: { + client_side_validation: true, + required: false, + serialized_name: 'lastEventReceived', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connectable_resource.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connectable_resource.rb new file mode 100644 index 000000000..3280a7f9d --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connectable_resource.rb @@ -0,0 +1,91 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes the allowed inbound and outbound traffic of an Azure resource + # + class ConnectableResource + + include MsRestAzure + + # @return [String] The Azure resource id + attr_accessor :id + + # @return [Array] The list of Azure resources that the + # resource has inbound allowed connection from + attr_accessor :inbound_connected_resources + + # @return [Array] The list of Azure resources that the + # resource has outbound allowed connection to + attr_accessor :outbound_connected_resources + + + # + # Mapper for ConnectableResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ConnectableResource', + type: { + name: 'Composite', + class_name: 'ConnectableResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + inbound_connected_resources: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'inboundConnectedResources', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ConnectedResourceElementType', + type: { + name: 'Composite', + class_name: 'ConnectedResource' + } + } + } + }, + outbound_connected_resources: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'outboundConnectedResources', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ConnectedResourceElementType', + type: { + name: 'Composite', + class_name: 'ConnectedResource' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connected_resource.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connected_resource.rb new file mode 100644 index 000000000..eb1275533 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connected_resource.rb @@ -0,0 +1,71 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes properties of a connected resource + # + class ConnectedResource + + include MsRestAzure + + # @return [String] The Azure resource id of the connected resource + attr_accessor :connected_resource_id + + # @return [String] The allowed tcp ports + attr_accessor :tcp_ports + + # @return [String] The allowed udp ports + attr_accessor :udp_ports + + + # + # Mapper for ConnectedResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ConnectedResource', + type: { + name: 'Composite', + class_name: 'ConnectedResource', + model_properties: { + connected_resource_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'connectedResourceId', + type: { + name: 'String' + } + }, + tcp_ports: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'tcpPorts', + type: { + name: 'String' + } + }, + udp_ports: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'udpPorts', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connected_workspace.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connected_workspace.rb new file mode 100644 index 000000000..0bc1f52ea --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connected_workspace.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Represents an OMS workspace to which the solution is connected + # + # + class ConnectedWorkspace + + include MsRestAzure + + # @return [String] Azure resource ID of the connected OMS workspace + attr_accessor :id + + + # + # Mapper for ConnectedWorkspace class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ConnectedWorkspace', + type: { + name: 'Composite', + class_name: 'ConnectedWorkspace', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connection_type.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connection_type.rb new file mode 100644 index 000000000..85cd3f4d5 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/connection_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for ConnectionType + # + module ConnectionType + Internal = "Internal" + External = "External" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/direction.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/direction.rb new file mode 100644 index 000000000..ee61919d5 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/direction.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for Direction + # + module Direction + Inbound = "Inbound" + Outbound = "Outbound" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution.rb new file mode 100644 index 000000000..f80dabc05 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution.rb @@ -0,0 +1,129 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class DiscoveredSecuritySolution + + include MsRestAzure + + # @return [String] Resource Id + attr_accessor :id + + # @return [String] Resource name + attr_accessor :name + + # @return [String] Resource type + attr_accessor :type + + # @return [String] Location where the resource is stored + attr_accessor :location + + # @return [SecurityFamily] The security family of the discovered + # solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' + attr_accessor :security_family + + # @return [String] The security solutions' image offer + attr_accessor :offer + + # @return [String] The security solutions' image publisher + attr_accessor :publisher + + # @return [String] The security solutions' image sku + attr_accessor :sku + + + # + # Mapper for DiscoveredSecuritySolution class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DiscoveredSecuritySolution', + type: { + name: 'Composite', + class_name: 'DiscoveredSecuritySolution', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + security_family: { + client_side_validation: true, + required: true, + serialized_name: 'properties.securityFamily', + type: { + name: 'String' + } + }, + offer: { + client_side_validation: true, + required: true, + serialized_name: 'properties.offer', + type: { + name: 'String' + } + }, + publisher: { + client_side_validation: true, + required: true, + serialized_name: 'properties.publisher', + type: { + name: 'String' + } + }, + sku: { + client_side_validation: true, + required: true, + serialized_name: 'properties.sku', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution_list.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution_list.rb new file mode 100644 index 000000000..7ff10b026 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution_list.rb @@ -0,0 +1,99 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + class DiscoveredSecuritySolutionList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] + attr_accessor :value + + # @return [String] The URI to fetch the next page. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [DiscoveredSecuritySolutionList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for DiscoveredSecuritySolutionList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DiscoveredSecuritySolutionList', + type: { + name: 'Composite', + class_name: 'DiscoveredSecuritySolutionList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DiscoveredSecuritySolutionElementType', + type: { + name: 'Composite', + class_name: 'DiscoveredSecuritySolution' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/effective_network_security_groups.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/effective_network_security_groups.rb new file mode 100644 index 000000000..8f5bd5452 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/effective_network_security_groups.rb @@ -0,0 +1,66 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes the Network Security Groups effective on a network interface + # + class EffectiveNetworkSecurityGroups + + include MsRestAzure + + # @return [String] The Azure resource ID of the network interface + attr_accessor :network_interface + + # @return [Array] The Network Security Groups effective on the + # network interface + attr_accessor :network_security_groups + + + # + # Mapper for EffectiveNetworkSecurityGroups class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EffectiveNetworkSecurityGroups', + type: { + name: 'Composite', + class_name: 'EffectiveNetworkSecurityGroups', + model_properties: { + network_interface: { + client_side_validation: true, + required: false, + serialized_name: 'networkInterface', + type: { + name: 'String' + } + }, + network_security_groups: { + client_side_validation: true, + required: false, + serialized_name: 'networkSecurityGroups', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/etag.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/etag.rb new file mode 100644 index 000000000..f61bcdf49 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/etag.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Entity tag is used for comparing two or more entities from the same + # requested resource. + # + class ETag + + include MsRestAzure + + # @return [String] Entity tag is used for comparing two or more entities + # from the same requested resource. + attr_accessor :etag + + + # + # Mapper for ETag class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ETag', + type: { + name: 'Composite', + class_name: 'ETag', + model_properties: { + etag: { + client_side_validation: true, + required: false, + serialized_name: 'etag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/expand_enum.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/expand_enum.rb new file mode 100644 index 000000000..b217a6c41 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/expand_enum.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for ExpandEnum + # + module ExpandEnum + Links = "links" + Metadata = "metadata" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution.rb new file mode 100644 index 000000000..ddbb02e03 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Represents a security solution external to Azure Security Center which + # sends information to an OMS workspace and whose data is displayed by + # Azure Security Center. + # + class ExternalSecuritySolution + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["CEF"] = "CefExternalSecuritySolution" + @@discriminatorMap["ATA"] = "AtaExternalSecuritySolution" + @@discriminatorMap["AAD"] = "AadExternalSecuritySolution" + + def initialize + @kind = "ExternalSecuritySolution" + end + + attr_accessor :kind + + # @return [String] Resource Id + attr_accessor :id + + # @return [String] Resource name + attr_accessor :name + + # @return [String] Resource type + attr_accessor :type + + # @return [String] Location where the resource is stored + attr_accessor :location + + + # + # Mapper for ExternalSecuritySolution class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExternalSecuritySolution', + type: { + name: 'Composite', + polymorphic_discriminator: 'kind', + uber_parent: 'ExternalSecuritySolution', + class_name: 'ExternalSecuritySolution', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind.rb new file mode 100644 index 000000000..0202c9aff --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for ExternalSecuritySolutionKind + # + module ExternalSecuritySolutionKind + CEF = "CEF" + ATA = "ATA" + AAD = "AAD" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind1.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind1.rb new file mode 100644 index 000000000..83731e16c --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind1.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes an Azure resource with kind + # + class ExternalSecuritySolutionKind1 + + include MsRestAzure + + # @return [ExternalSecuritySolutionKind] The kind of the external + # solution. Possible values include: 'CEF', 'ATA', 'AAD' + attr_accessor :kind + + + # + # Mapper for ExternalSecuritySolutionKind1 class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExternalSecuritySolutionKind', + type: { + name: 'Composite', + class_name: 'ExternalSecuritySolutionKind1', + model_properties: { + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_list.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_list.rb new file mode 100644 index 000000000..628c35efb --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_list.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + class ExternalSecuritySolutionList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] + attr_accessor :value + + # @return [String] The URI to fetch the next page. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ExternalSecuritySolutionList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ExternalSecuritySolutionList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExternalSecuritySolutionList', + type: { + name: 'Composite', + class_name: 'ExternalSecuritySolutionList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ExternalSecuritySolutionElementType', + type: { + name: 'Composite', + polymorphic_discriminator: 'kind', + uber_parent: 'ExternalSecuritySolution', + class_name: 'ExternalSecuritySolution' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_properties.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_properties.rb new file mode 100644 index 000000000..f01389f99 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_properties.rb @@ -0,0 +1,88 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # The solution properties (correspond to the solution kind) + # + class ExternalSecuritySolutionProperties + + include MsRestAzure + + # @return Unmatched properties from the message are deserialized this + # collection + attr_accessor :additional_properties + + # @return [String] + attr_accessor :device_vendor + + # @return [String] + attr_accessor :device_type + + # @return [ConnectedWorkspace] + attr_accessor :workspace + + + # + # Mapper for ExternalSecuritySolutionProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExternalSecuritySolutionProperties', + type: { + name: 'Composite', + class_name: 'ExternalSecuritySolutionProperties', + model_properties: { + additional_properties: { + client_side_validation: true, + required: false, + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + device_vendor: { + client_side_validation: true, + required: false, + serialized_name: 'deviceVendor', + type: { + name: 'String' + } + }, + device_type: { + client_side_validation: true, + required: false, + serialized_name: 'deviceType', + type: { + name: 'String' + } + }, + workspace: { + client_side_validation: true, + required: false, + serialized_name: 'workspace', + type: { + name: 'Composite', + class_name: 'ConnectedWorkspace' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/implementation_effort.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/implementation_effort.rb new file mode 100644 index 000000000..2ee8993ea --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/implementation_effort.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for ImplementationEffort + # + module ImplementationEffort + Low = "Low" + Moderate = "Moderate" + High = "High" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policies_list.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policies_list.rb new file mode 100644 index 000000000..0a4d8abf1 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policies_list.rb @@ -0,0 +1,99 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + class JitNetworkAccessPoliciesList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] + attr_accessor :value + + # @return [String] The URI to fetch the next page. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [JitNetworkAccessPoliciesList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for JitNetworkAccessPoliciesList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPoliciesList', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPoliciesList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPolicyElementType', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPolicy' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy.rb new file mode 100644 index 000000000..27d385fab --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy.rb @@ -0,0 +1,149 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class JitNetworkAccessPolicy + + include MsRestAzure + + # @return [String] Resource Id + attr_accessor :id + + # @return [String] Resource name + attr_accessor :name + + # @return [String] Resource type + attr_accessor :type + + # @return [String] Kind of the resource + attr_accessor :kind + + # @return [String] Location where the resource is stored + attr_accessor :location + + # @return [Array] Configurations + # for Microsoft.Compute/virtualMachines resource type. + attr_accessor :virtual_machines + + # @return [Array] + attr_accessor :requests + + # @return [String] Gets the provisioning state of the Just-in-Time + # policy. + attr_accessor :provisioning_state + + + # + # Mapper for JitNetworkAccessPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPolicy', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPolicy', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + virtual_machines: { + client_side_validation: true, + required: true, + serialized_name: 'properties.virtualMachines', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPolicyVirtualMachineElementType', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPolicyVirtualMachine' + } + } + } + }, + requests: { + client_side_validation: true, + required: false, + serialized_name: 'properties.requests', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessRequestElementType', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessRequest' + } + } + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_port.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_port.rb new file mode 100644 index 000000000..105dd3f51 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_port.rb @@ -0,0 +1,70 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class JitNetworkAccessPolicyInitiatePort + + include MsRestAzure + + # @return [Integer] + attr_accessor :number + + # @return [String] Source of the allowed traffic. If omitted, the request + # will be for the source IP address of the initiate request. + attr_accessor :allowed_source_address_prefix + + # @return [DateTime] The time to close the request in UTC + attr_accessor :end_time_utc + + + # + # Mapper for JitNetworkAccessPolicyInitiatePort class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPolicyInitiatePort', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPolicyInitiatePort', + model_properties: { + number: { + client_side_validation: true, + required: true, + serialized_name: 'number', + type: { + name: 'Number' + } + }, + allowed_source_address_prefix: { + client_side_validation: true, + required: false, + serialized_name: 'allowedSourceAddressPrefix', + type: { + name: 'String' + } + }, + end_time_utc: { + client_side_validation: true, + required: true, + serialized_name: 'endTimeUtc', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_request.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_request.rb new file mode 100644 index 000000000..6880bdef2 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_request.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class JitNetworkAccessPolicyInitiateRequest + + include MsRestAzure + + # @return [Array] A list of + # virtual machines & ports to open access for + attr_accessor :virtual_machines + + # @return [String] The justification for making the initiate request + attr_accessor :justification + + + # + # Mapper for JitNetworkAccessPolicyInitiateRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPolicyInitiateRequest', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPolicyInitiateRequest', + model_properties: { + virtual_machines: { + client_side_validation: true, + required: true, + serialized_name: 'virtualMachines', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPolicyInitiateVirtualMachineElementType', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPolicyInitiateVirtualMachine' + } + } + } + }, + justification: { + client_side_validation: true, + required: false, + serialized_name: 'justification', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_virtual_machine.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_virtual_machine.rb new file mode 100644 index 000000000..7cc49af12 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_virtual_machine.rb @@ -0,0 +1,70 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class JitNetworkAccessPolicyInitiateVirtualMachine + + include MsRestAzure + + # @return [String] Resource ID of the virtual machine that is linked to + # this policy + attr_accessor :id + + # @return [Array] The ports to open + # for the resource with the `id` + attr_accessor :ports + + + # + # Mapper for JitNetworkAccessPolicyInitiateVirtualMachine class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPolicyInitiateVirtualMachine', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPolicyInitiateVirtualMachine', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + ports: { + client_side_validation: true, + required: true, + serialized_name: 'ports', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPolicyInitiatePortElementType', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPolicyInitiatePort' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_virtual_machine.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_virtual_machine.rb new file mode 100644 index 000000000..88be6e071 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_virtual_machine.rb @@ -0,0 +1,81 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class JitNetworkAccessPolicyVirtualMachine + + include MsRestAzure + + # @return [String] Resource ID of the virtual machine that is linked to + # this policy + attr_accessor :id + + # @return [Array] Port configurations for the + # virtual machine + attr_accessor :ports + + # @return [String] Public IP address of the Azure Firewall that is linked + # to this policy, if applicable + attr_accessor :public_ip_address + + + # + # Mapper for JitNetworkAccessPolicyVirtualMachine class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPolicyVirtualMachine', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPolicyVirtualMachine', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + ports: { + client_side_validation: true, + required: true, + serialized_name: 'ports', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPortRuleElementType', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPortRule' + } + } + } + }, + public_ip_address: { + client_side_validation: true, + required: false, + serialized_name: 'publicIpAddress', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_port_rule.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_port_rule.rb new file mode 100644 index 000000000..d327c0613 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_port_rule.rb @@ -0,0 +1,103 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class JitNetworkAccessPortRule + + include MsRestAzure + + # @return [Integer] + attr_accessor :number + + # @return [Protocol] Possible values include: 'TCP', 'UDP', 'All' + attr_accessor :protocol + + # @return [String] Mutually exclusive with the + # "allowedSourceAddressPrefixes" parameter. Should be an IP address or + # CIDR, for example "192.168.0.3" or "192.168.0.0/16". + attr_accessor :allowed_source_address_prefix + + # @return [Array] Mutually exclusive with the + # "allowedSourceAddressPrefix" parameter. + attr_accessor :allowed_source_address_prefixes + + # @return [String] Maximum duration requests can be made for. In ISO 8601 + # duration format. Minimum 5 minutes, maximum 1 day + attr_accessor :max_request_access_duration + + + # + # Mapper for JitNetworkAccessPortRule class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessPortRule', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessPortRule', + model_properties: { + number: { + client_side_validation: true, + required: true, + serialized_name: 'number', + type: { + name: 'Number' + } + }, + protocol: { + client_side_validation: true, + required: true, + serialized_name: 'protocol', + type: { + name: 'String' + } + }, + allowed_source_address_prefix: { + client_side_validation: true, + required: false, + serialized_name: 'allowedSourceAddressPrefix', + type: { + name: 'String' + } + }, + allowed_source_address_prefixes: { + client_side_validation: true, + required: false, + serialized_name: 'allowedSourceAddressPrefixes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + max_request_access_duration: { + client_side_validation: true, + required: true, + serialized_name: 'maxRequestAccessDuration', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request.rb new file mode 100644 index 000000000..8026f8218 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request.rb @@ -0,0 +1,89 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class JitNetworkAccessRequest + + include MsRestAzure + + # @return [Array] + attr_accessor :virtual_machines + + # @return [DateTime] The start time of the request in UTC + attr_accessor :start_time_utc + + # @return [String] The identity of the person who made the request + attr_accessor :requestor + + # @return [String] The justification for making the initiate request + attr_accessor :justification + + + # + # Mapper for JitNetworkAccessRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessRequest', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessRequest', + model_properties: { + virtual_machines: { + client_side_validation: true, + required: true, + serialized_name: 'virtualMachines', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessRequestVirtualMachineElementType', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessRequestVirtualMachine' + } + } + } + }, + start_time_utc: { + client_side_validation: true, + required: true, + serialized_name: 'startTimeUtc', + type: { + name: 'DateTime' + } + }, + requestor: { + client_side_validation: true, + required: true, + serialized_name: 'requestor', + type: { + name: 'String' + } + }, + justification: { + client_side_validation: true, + required: false, + serialized_name: 'justification', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_port.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_port.rb new file mode 100644 index 000000000..2b9488095 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_port.rb @@ -0,0 +1,128 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class JitNetworkAccessRequestPort + + include MsRestAzure + + # @return [Integer] + attr_accessor :number + + # @return [String] Mutually exclusive with the + # "allowedSourceAddressPrefixes" parameter. Should be an IP address or + # CIDR, for example "192.168.0.3" or "192.168.0.0/16". + attr_accessor :allowed_source_address_prefix + + # @return [Array] Mutually exclusive with the + # "allowedSourceAddressPrefix" parameter. + attr_accessor :allowed_source_address_prefixes + + # @return [DateTime] The date & time at which the request ends in UTC + attr_accessor :end_time_utc + + # @return [Status] The status of the port. Possible values include: + # 'Revoked', 'Initiated' + attr_accessor :status + + # @return [StatusReason] A description of why the `status` has its value. + # Possible values include: 'Expired', 'UserRequested', + # 'NewerRequestInitiated' + attr_accessor :status_reason + + # @return [Integer] The port which is mapped to this port's `number` in + # the Azure Firewall, if applicable + attr_accessor :mapped_port + + + # + # Mapper for JitNetworkAccessRequestPort class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessRequestPort', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessRequestPort', + model_properties: { + number: { + client_side_validation: true, + required: true, + serialized_name: 'number', + type: { + name: 'Number' + } + }, + allowed_source_address_prefix: { + client_side_validation: true, + required: false, + serialized_name: 'allowedSourceAddressPrefix', + type: { + name: 'String' + } + }, + allowed_source_address_prefixes: { + client_side_validation: true, + required: false, + serialized_name: 'allowedSourceAddressPrefixes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + end_time_utc: { + client_side_validation: true, + required: true, + serialized_name: 'endTimeUtc', + type: { + name: 'DateTime' + } + }, + status: { + client_side_validation: true, + required: true, + serialized_name: 'status', + type: { + name: 'String' + } + }, + status_reason: { + client_side_validation: true, + required: true, + serialized_name: 'statusReason', + type: { + name: 'String' + } + }, + mapped_port: { + client_side_validation: true, + required: false, + serialized_name: 'mappedPort', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_virtual_machine.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_virtual_machine.rb new file mode 100644 index 000000000..4e6133752 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_virtual_machine.rb @@ -0,0 +1,69 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class JitNetworkAccessRequestVirtualMachine + + include MsRestAzure + + # @return [String] Resource ID of the virtual machine that is linked to + # this policy + attr_accessor :id + + # @return [Array] The ports that were opened + # for the virtual machine + attr_accessor :ports + + + # + # Mapper for JitNetworkAccessRequestVirtualMachine class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessRequestVirtualMachine', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessRequestVirtualMachine', + model_properties: { + id: { + client_side_validation: true, + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + ports: { + client_side_validation: true, + required: true, + serialized_name: 'ports', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'JitNetworkAccessRequestPortElementType', + type: { + name: 'Composite', + class_name: 'JitNetworkAccessRequestPort' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/kind.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/kind.rb new file mode 100644 index 000000000..c21e5b599 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/kind.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes an Azure resource with kind + # + class Kind + + include MsRestAzure + + # @return [String] Kind of the resource + attr_accessor :kind + + + # + # Mapper for Kind class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Kind', + type: { + name: 'Composite', + class_name: 'Kind', + model_properties: { + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/location.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/location.rb new file mode 100644 index 000000000..52399a324 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/location.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes an Azure resource with location + # + class Location + + include MsRestAzure + + # @return [String] Location where the resource is stored + attr_accessor :location + + + # + # Mapper for Location class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Location', + type: { + name: 'Composite', + class_name: 'Location', + model_properties: { + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/on_premise_resource_details.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/on_premise_resource_details.rb new file mode 100644 index 000000000..9bf7bcb03 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/on_premise_resource_details.rb @@ -0,0 +1,95 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Details of the On Premise resource that was assessed + # + class OnPremiseResourceDetails < ResourceDetails + + include MsRestAzure + + + def initialize + @source = "OnPremise" + end + + attr_accessor :source + + # @return [String] Azure resource Id of the workspace the machine is + # attached to + attr_accessor :workspace_id + + # @return [String] The unique Id of the machine + attr_accessor :vmuuid + + # @return [String] The oms agent Id installed on the machine + attr_accessor :source_computer_id + + # @return [String] The name of the machine + attr_accessor :machine_name + + + # + # Mapper for OnPremiseResourceDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OnPremise', + type: { + name: 'Composite', + class_name: 'OnPremiseResourceDetails', + model_properties: { + source: { + client_side_validation: true, + required: true, + serialized_name: 'source', + type: { + name: 'String' + } + }, + workspace_id: { + client_side_validation: true, + required: true, + serialized_name: 'workspaceId', + type: { + name: 'String' + } + }, + vmuuid: { + client_side_validation: true, + required: true, + serialized_name: 'vmuuid', + type: { + name: 'String' + } + }, + source_computer_id: { + client_side_validation: true, + required: true, + serialized_name: 'sourceComputerId', + type: { + name: 'String' + } + }, + machine_name: { + client_side_validation: true, + required: true, + serialized_name: 'machineName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/path_recommendation.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/path_recommendation.rb new file mode 100644 index 000000000..abb57165d --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/path_recommendation.rb @@ -0,0 +1,156 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Represents a path that is recommended to be allowed and its properties + # + class PathRecommendation + + include MsRestAzure + + # @return [String] The full path to whitelist + attr_accessor :path + + # @return [Enum] Possible values include: 'Recommended', 'Add', 'Remove' + attr_accessor :action + + # @return [Enum] Possible values include: 'File', 'FileHash', + # 'PublisherSignature', 'ProductSignature', 'BinarySignature', + # 'VersionAndAboveSignature' + attr_accessor :type + + # @return [PublisherInfo] + attr_accessor :publisher_info + + # @return [Boolean] Whether the path is commonly run on the machine + attr_accessor :common + + # @return [Array] + attr_accessor :user_sids + + # @return [Array] + attr_accessor :usernames + + # @return [Enum] Possible values include: 'Exe', 'Dll', 'Msi', 'Script', + # 'Executable', 'Unknown' + attr_accessor :file_type + + # @return [Enum] Possible values include: 'Configured', 'NotConfigured', + # 'InProgress', 'Failed', 'NoStatus' + attr_accessor :configuration_status + + + # + # Mapper for PathRecommendation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PathRecommendation', + type: { + name: 'Composite', + class_name: 'PathRecommendation', + model_properties: { + path: { + client_side_validation: true, + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + action: { + client_side_validation: true, + required: false, + serialized_name: 'action', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + }, + publisher_info: { + client_side_validation: true, + required: false, + serialized_name: 'publisherInfo', + type: { + name: 'Composite', + class_name: 'PublisherInfo' + } + }, + common: { + client_side_validation: true, + required: false, + serialized_name: 'common', + type: { + name: 'Boolean' + } + }, + user_sids: { + client_side_validation: true, + required: false, + serialized_name: 'userSids', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + usernames: { + client_side_validation: true, + required: false, + serialized_name: 'usernames', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'UserRecommendationElementType', + type: { + name: 'Composite', + class_name: 'UserRecommendation' + } + } + } + }, + file_type: { + client_side_validation: true, + required: false, + serialized_name: 'fileType', + type: { + name: 'String' + } + }, + configuration_status: { + client_side_validation: true, + required: false, + serialized_name: 'configurationStatus', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/protection_mode.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/protection_mode.rb new file mode 100644 index 000000000..c3eb11251 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/protection_mode.rb @@ -0,0 +1,80 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # The protection mode of the collection/file types. Exe/Msi/Script are used + # for Windows, Executable is used for Linux. + # + class ProtectionMode + + include MsRestAzure + + # @return [Enum] Possible values include: 'Audit', 'Enforce', 'None' + attr_accessor :exe + + # @return [Enum] Possible values include: 'Audit', 'Enforce', 'None' + attr_accessor :msi + + # @return [Enum] Possible values include: 'Audit', 'Enforce', 'None' + attr_accessor :script + + # @return [Enum] Possible values include: 'Audit', 'Enforce', 'None' + attr_accessor :executable + + + # + # Mapper for ProtectionMode class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ProtectionMode', + type: { + name: 'Composite', + class_name: 'ProtectionMode', + model_properties: { + exe: { + client_side_validation: true, + required: false, + serialized_name: 'exe', + type: { + name: 'String' + } + }, + msi: { + client_side_validation: true, + required: false, + serialized_name: 'msi', + type: { + name: 'String' + } + }, + script: { + client_side_validation: true, + required: false, + serialized_name: 'script', + type: { + name: 'String' + } + }, + executable: { + client_side_validation: true, + required: false, + serialized_name: 'executable', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/protocol.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/protocol.rb new file mode 100644 index 000000000..691e21e04 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/protocol.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for Protocol + # + module Protocol + TCP = "TCP" + UDP = "UDP" + All = "*" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/publisher_info.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/publisher_info.rb new file mode 100644 index 000000000..7703836d9 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/publisher_info.rb @@ -0,0 +1,84 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Represents the publisher information of a process/rule + # + class PublisherInfo + + include MsRestAzure + + # @return [String] The Subject field of the x.509 certificate used to + # sign the code, using the following fields - O = Organization, L = + # Locality, S = State or Province, and C = Country + attr_accessor :publisher_name + + # @return [String] The product name taken from the file's version + # resource + attr_accessor :product_name + + # @return [String] The "OriginalName" field taken from the file's version + # resource + attr_accessor :binary_name + + # @return [String] The binary file version taken from the file's version + # resource + attr_accessor :version + + + # + # Mapper for PublisherInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PublisherInfo', + type: { + name: 'Composite', + class_name: 'PublisherInfo', + model_properties: { + publisher_name: { + client_side_validation: true, + required: false, + serialized_name: 'publisherName', + type: { + name: 'String' + } + }, + product_name: { + client_side_validation: true, + required: false, + serialized_name: 'productName', + type: { + name: 'String' + } + }, + binary_name: { + client_side_validation: true, + required: false, + serialized_name: 'binaryName', + type: { + name: 'String' + } + }, + version: { + client_side_validation: true, + required: false, + serialized_name: 'version', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/resource.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/resource.rb new file mode 100644 index 000000000..7d04ff495 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/resource.rb @@ -0,0 +1,80 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes an Azure resource. + # + class Resource + + include MsRestAzure + + # @return [String] Resource Id + attr_accessor :id + + # @return [String] Resource name + attr_accessor :name + + # @return [String] Resource type + attr_accessor :type + + + # @return [String] the name of the resource group of the resource. + def resource_group + unless self.id.nil? + groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/) + groups.captures[0].strip if groups + end + end + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/resource_details.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/resource_details.rb new file mode 100644 index 000000000..c201ac886 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/resource_details.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Details of the resource that was assessed + # + class ResourceDetails + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["OnPremise"] = "OnPremiseResourceDetails" + @@discriminatorMap["Azure"] = "AzureResourceDetails" + + def initialize + @source = "ResourceDetails" + end + + attr_accessor :source + + + # + # Mapper for ResourceDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResourceDetails', + type: { + name: 'Composite', + polymorphic_discriminator: 'source', + uber_parent: 'ResourceDetails', + class_name: 'ResourceDetails', + model_properties: { + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/rule.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/rule.rb new file mode 100644 index 000000000..fd2c65d55 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/rule.rb @@ -0,0 +1,111 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes remote addresses that is recommended to communicate with the + # Azure resource on some (Protocol, Port, Direction). All other remote + # addresses are recommended to be blocked + # + class Rule + + include MsRestAzure + + # @return [String] The name of the rule + attr_accessor :name + + # @return [Direction] The rule's direction. Possible values include: + # 'Inbound', 'Outbound' + attr_accessor :direction + + # @return [Integer] The rule's destination port + attr_accessor :destination_port + + # @return [Array] The rule's transport protocols + attr_accessor :protocols + + # @return [Array] The remote IP addresses that should be able to + # communicate with the Azure resource on the rule's destination port and + # protocol + attr_accessor :ip_addresses + + + # + # Mapper for Rule class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Rule', + type: { + name: 'Composite', + class_name: 'Rule', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + direction: { + client_side_validation: true, + required: false, + serialized_name: 'direction', + type: { + name: 'String' + } + }, + destination_port: { + client_side_validation: true, + required: false, + serialized_name: 'destinationPort', + type: { + name: 'Number' + } + }, + protocols: { + client_side_validation: true, + required: false, + serialized_name: 'protocols', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TransportProtocolElementType', + type: { + name: 'String' + } + } + } + }, + ip_addresses: { + client_side_validation: true, + required: false, + serialized_name: 'ipAddresses', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment.rb new file mode 100644 index 000000000..d69a38db9 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment.rb @@ -0,0 +1,156 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Security assessment on a resource + # + class SecurityAssessment < Resource + + include MsRestAzure + + # @return [ResourceDetails] + attr_accessor :resource_details + + # @return [String] User friendly display name of the assessment + attr_accessor :display_name + + # @return [AssessmentStatus] + attr_accessor :status + + # @return [Hash{String => String}] Additional data regarding the + # assessment + attr_accessor :additional_data + + # @return [AssessmentLinks] + attr_accessor :links + + # @return [SecurityAssessmentMetadataProperties] + attr_accessor :metadata + + # @return [SecurityAssessmentPartnerData] + attr_accessor :partners_data + + + # + # Mapper for SecurityAssessment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecurityAssessment', + type: { + name: 'Composite', + class_name: 'SecurityAssessment', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + resource_details: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resourceDetails', + type: { + name: 'Composite', + polymorphic_discriminator: 'source', + uber_parent: 'ResourceDetails', + class_name: 'ResourceDetails' + } + }, + display_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + status: { + client_side_validation: true, + required: true, + serialized_name: 'properties.status', + type: { + name: 'Composite', + class_name: 'AssessmentStatus' + } + }, + additional_data: { + client_side_validation: true, + required: false, + serialized_name: 'properties.additionalData', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + links: { + client_side_validation: true, + required: false, + serialized_name: 'properties.links', + type: { + name: 'Composite', + class_name: 'AssessmentLinks' + } + }, + metadata: { + client_side_validation: true, + required: false, + serialized_name: 'properties.metadata', + type: { + name: 'Composite', + class_name: 'SecurityAssessmentMetadataProperties' + } + }, + partners_data: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnersData', + type: { + name: 'Composite', + class_name: 'SecurityAssessmentPartnerData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_list.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_list.rb new file mode 100644 index 000000000..d46f4bed3 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_list.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Page of a security assessments list + # + class SecurityAssessmentList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Collection of security assessments + # in this page + attr_accessor :value + + # @return [String] The URI to fetch the next page. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [SecurityAssessmentList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for SecurityAssessmentList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecurityAssessmentList', + type: { + name: 'Composite', + class_name: 'SecurityAssessmentList', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SecurityAssessmentElementType', + type: { + name: 'Composite', + class_name: 'SecurityAssessment' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata.rb new file mode 100644 index 000000000..e2736d9b4 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata.rb @@ -0,0 +1,221 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Security assessment metadata + # + class SecurityAssessmentMetadata < Resource + + include MsRestAzure + + # @return [String] User friendly display name of the assessment + attr_accessor :display_name + + # @return [String] Azure resource ID of the policy definition that turns + # this assessment calculation on + attr_accessor :policy_definition_id + + # @return [String] Human readable description of the assessment + attr_accessor :description + + # @return [String] Human readable description of what you should do to + # mitigate this security issue + attr_accessor :remediation_description + + # @return [Array] + attr_accessor :category + + # @return [Severity] The severity level of the assessment. Possible + # values include: 'Low', 'Medium', 'High' + attr_accessor :severity + + # @return [UserImpact] The user impact of the assessment. Possible values + # include: 'Low', 'Moderate', 'High' + attr_accessor :user_impact + + # @return [ImplementationEffort] The implementation effort required to + # remediate this assessment. Possible values include: 'Low', 'Moderate', + # 'High' + attr_accessor :implementation_effort + + # @return [Array] + attr_accessor :threats + + # @return [Boolean] True if this assessment is in preview release status + attr_accessor :preview + + # @return [AssessmentType] BuiltIn if the assessment based on built-in + # Azure Policy definition, Custom if the assessment based on custom Azure + # Policy definition. Possible values include: 'BuiltIn', 'CustomPolicy', + # 'CustomerManaged', 'VerifiedPartner' + attr_accessor :assessment_type + + # @return [SecurityAssessmentMetadataPartnerData] + attr_accessor :partner_data + + + # + # Mapper for SecurityAssessmentMetadata class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecurityAssessmentMetadata', + type: { + name: 'Composite', + class_name: 'SecurityAssessmentMetadata', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + display_name: { + client_side_validation: true, + required: true, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + policy_definition_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.policyDefinitionId', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + remediation_description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.remediationDescription', + type: { + name: 'String' + } + }, + category: { + client_side_validation: true, + required: false, + serialized_name: 'properties.category', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CategoryElementType', + type: { + name: 'String' + } + } + } + }, + severity: { + client_side_validation: true, + required: true, + serialized_name: 'properties.severity', + type: { + name: 'String' + } + }, + user_impact: { + client_side_validation: true, + required: false, + serialized_name: 'properties.userImpact', + type: { + name: 'String' + } + }, + implementation_effort: { + client_side_validation: true, + required: false, + serialized_name: 'properties.implementationEffort', + type: { + name: 'String' + } + }, + threats: { + client_side_validation: true, + required: false, + serialized_name: 'properties.threats', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ThreatsElementType', + type: { + name: 'String' + } + } + } + }, + preview: { + client_side_validation: true, + required: false, + serialized_name: 'properties.preview', + type: { + name: 'Boolean' + } + }, + assessment_type: { + client_side_validation: true, + required: true, + serialized_name: 'properties.assessmentType', + type: { + name: 'String' + } + }, + partner_data: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnerData', + type: { + name: 'Composite', + class_name: 'SecurityAssessmentMetadataPartnerData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_list.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_list.rb new file mode 100644 index 000000000..6fe6a881a --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_list.rb @@ -0,0 +1,100 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # List of security assessment metadata + # + class SecurityAssessmentMetadataList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] + attr_accessor :value + + # @return [String] The URI to fetch the next page. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [SecurityAssessmentMetadataList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for SecurityAssessmentMetadataList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecurityAssessmentMetadataList', + type: { + name: 'Composite', + class_name: 'SecurityAssessmentMetadataList', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SecurityAssessmentMetadataElementType', + type: { + name: 'Composite', + class_name: 'SecurityAssessmentMetadata' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_partner_data.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_partner_data.rb new file mode 100644 index 000000000..979f4ae15 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_partner_data.rb @@ -0,0 +1,70 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes the partner that created the assessment + # + class SecurityAssessmentMetadataPartnerData + + include MsRestAzure + + # @return [String] Name of the company of the partner + attr_accessor :partner_name + + # @return [String] Name of the product of the partner that created the + # assessment + attr_accessor :product_name + + # @return [String] Secret to authenticate the partner and verify it + # created the assessment - write only + attr_accessor :secret + + + # + # Mapper for SecurityAssessmentMetadataPartnerData class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecurityAssessmentMetadataPartnerData', + type: { + name: 'Composite', + class_name: 'SecurityAssessmentMetadataPartnerData', + model_properties: { + partner_name: { + client_side_validation: true, + required: true, + serialized_name: 'partnerName', + type: { + name: 'String' + } + }, + product_name: { + client_side_validation: true, + required: false, + serialized_name: 'productName', + type: { + name: 'String' + } + }, + secret: { + client_side_validation: true, + required: true, + serialized_name: 'secret', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_properties.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_properties.rb new file mode 100644 index 000000000..c18135cf6 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_properties.rb @@ -0,0 +1,194 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes properties of an assessment metadata. + # + class SecurityAssessmentMetadataProperties + + include MsRestAzure + + # @return [String] User friendly display name of the assessment + attr_accessor :display_name + + # @return [String] Azure resource ID of the policy definition that turns + # this assessment calculation on + attr_accessor :policy_definition_id + + # @return [String] Human readable description of the assessment + attr_accessor :description + + # @return [String] Human readable description of what you should do to + # mitigate this security issue + attr_accessor :remediation_description + + # @return [Array] + attr_accessor :category + + # @return [Severity] The severity level of the assessment. Possible + # values include: 'Low', 'Medium', 'High' + attr_accessor :severity + + # @return [UserImpact] The user impact of the assessment. Possible values + # include: 'Low', 'Moderate', 'High' + attr_accessor :user_impact + + # @return [ImplementationEffort] The implementation effort required to + # remediate this assessment. Possible values include: 'Low', 'Moderate', + # 'High' + attr_accessor :implementation_effort + + # @return [Array] + attr_accessor :threats + + # @return [Boolean] True if this assessment is in preview release status + attr_accessor :preview + + # @return [AssessmentType] BuiltIn if the assessment based on built-in + # Azure Policy definition, Custom if the assessment based on custom Azure + # Policy definition. Possible values include: 'BuiltIn', 'CustomPolicy', + # 'CustomerManaged', 'VerifiedPartner' + attr_accessor :assessment_type + + # @return [SecurityAssessmentMetadataPartnerData] + attr_accessor :partner_data + + + # + # Mapper for SecurityAssessmentMetadataProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecurityAssessmentMetadataProperties', + type: { + name: 'Composite', + class_name: 'SecurityAssessmentMetadataProperties', + model_properties: { + display_name: { + client_side_validation: true, + required: true, + serialized_name: 'displayName', + type: { + name: 'String' + } + }, + policy_definition_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'policyDefinitionId', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + remediation_description: { + client_side_validation: true, + required: false, + serialized_name: 'remediationDescription', + type: { + name: 'String' + } + }, + category: { + client_side_validation: true, + required: false, + serialized_name: 'category', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CategoryElementType', + type: { + name: 'String' + } + } + } + }, + severity: { + client_side_validation: true, + required: true, + serialized_name: 'severity', + type: { + name: 'String' + } + }, + user_impact: { + client_side_validation: true, + required: false, + serialized_name: 'userImpact', + type: { + name: 'String' + } + }, + implementation_effort: { + client_side_validation: true, + required: false, + serialized_name: 'implementationEffort', + type: { + name: 'String' + } + }, + threats: { + client_side_validation: true, + required: false, + serialized_name: 'threats', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ThreatsElementType', + type: { + name: 'String' + } + } + } + }, + preview: { + client_side_validation: true, + required: false, + serialized_name: 'preview', + type: { + name: 'Boolean' + } + }, + assessment_type: { + client_side_validation: true, + required: true, + serialized_name: 'assessmentType', + type: { + name: 'String' + } + }, + partner_data: { + client_side_validation: true, + required: false, + serialized_name: 'partnerData', + type: { + name: 'Composite', + class_name: 'SecurityAssessmentMetadataPartnerData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_partner_data.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_partner_data.rb new file mode 100644 index 000000000..f669adb17 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_partner_data.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Data regarding 3rd party partner integration + # + class SecurityAssessmentPartnerData + + include MsRestAzure + + # @return [String] Name of the company of the partner + attr_accessor :partner_name + + # @return [String] secret to authenticate the partner - write only + attr_accessor :secret + + + # + # Mapper for SecurityAssessmentPartnerData class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecurityAssessmentPartnerData', + type: { + name: 'Composite', + class_name: 'SecurityAssessmentPartnerData', + model_properties: { + partner_name: { + client_side_validation: true, + required: true, + serialized_name: 'partnerName', + type: { + name: 'String' + } + }, + secret: { + client_side_validation: true, + required: true, + serialized_name: 'secret', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_family.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_family.rb new file mode 100644 index 000000000..2719cb797 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/security_family.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for SecurityFamily + # + module SecurityFamily + Waf = "Waf" + Ngfw = "Ngfw" + SaasWaf = "SaasWaf" + Va = "Va" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessment.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessment.rb new file mode 100644 index 000000000..7c47fef35 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessment.rb @@ -0,0 +1,76 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes the server vulnerability assessment details on a resource + # + class ServerVulnerabilityAssessment < Resource + + include MsRestAzure + + # @return [Enum] The provisioningState of the vulnerability assessment + # capability on the VM. Possible values include: 'Succeeded', 'Failed', + # 'Canceled', 'Provisioning', 'Deprovisioning' + attr_accessor :provisioning_state + + + # + # Mapper for ServerVulnerabilityAssessment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ServerVulnerabilityAssessment', + type: { + name: 'Composite', + class_name: 'ServerVulnerabilityAssessment', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessments_list.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessments_list.rb new file mode 100644 index 000000000..5bbb5c89a --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessments_list.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # List of server vulnerability assessments + # + class ServerVulnerabilityAssessmentsList + + include MsRestAzure + + # @return [Array] + attr_accessor :value + + + # + # Mapper for ServerVulnerabilityAssessmentsList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ServerVulnerabilityAssessmentsList', + type: { + name: 'Composite', + class_name: 'ServerVulnerabilityAssessmentsList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ServerVulnerabilityAssessmentElementType', + type: { + name: 'Composite', + class_name: 'ServerVulnerabilityAssessment' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/severity.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/severity.rb new file mode 100644 index 000000000..985083b4c --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/severity.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for Severity + # + module Severity + Low = "Low" + Medium = "Medium" + High = "High" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/status.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/status.rb new file mode 100644 index 000000000..4b50a070e --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/status.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for Status + # + module Status + Revoked = "Revoked" + Initiated = "Initiated" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/status_reason.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/status_reason.rb new file mode 100644 index 000000000..68bfacbbc --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/status_reason.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for StatusReason + # + module StatusReason + Expired = "Expired" + UserRequested = "UserRequested" + NewerRequestInitiated = "NewerRequestInitiated" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/tags.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/tags.rb new file mode 100644 index 000000000..5d6a2add8 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/tags.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # A list of key value pairs that describe the resource. + # + class Tags + + include MsRestAzure + + # @return [Hash{String => String}] A list of key value pairs that + # describe the resource. + attr_accessor :tags + + + # + # Mapper for Tags class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Tags', + type: { + name: 'Composite', + class_name: 'Tags', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/threats.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/threats.rb new file mode 100644 index 000000000..26d7a658a --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/threats.rb @@ -0,0 +1,22 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for Threats + # + module Threats + AccountBreach = "accountBreach" + DataExfiltration = "dataExfiltration" + DataSpillage = "dataSpillage" + MaliciousInsider = "maliciousInsider" + ElevationOfPrivilege = "elevationOfPrivilege" + ThreatResistance = "threatResistance" + MissingCoverage = "missingCoverage" + DenialOfService = "denialOfService" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_list.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_list.rb new file mode 100644 index 000000000..68735bf46 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_list.rb @@ -0,0 +1,100 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + class TopologyList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] + attr_accessor :value + + # @return [String] The URI to fetch the next page. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [TopologyList] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for TopologyList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopologyList', + type: { + name: 'Composite', + class_name: 'TopologyList', + model_properties: { + value: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TopologyResourceElementType', + type: { + name: 'Composite', + class_name: 'TopologyResource' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_resource.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_resource.rb new file mode 100644 index 000000000..52113ee49 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_resource.rb @@ -0,0 +1,118 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class TopologyResource + + include MsRestAzure + + # @return [String] Resource Id + attr_accessor :id + + # @return [String] Resource name + attr_accessor :name + + # @return [String] Resource type + attr_accessor :type + + # @return [String] Location where the resource is stored + attr_accessor :location + + # @return [DateTime] The UTC time on which the topology was calculated + attr_accessor :calculated_date_time + + # @return [Array] Azure resources which are part + # of this topology resource + attr_accessor :topology_resources + + + # + # Mapper for TopologyResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopologyResource', + type: { + name: 'Composite', + class_name: 'TopologyResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + calculated_date_time: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.calculatedDateTime', + type: { + name: 'DateTime' + } + }, + topology_resources: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.topologyResources', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TopologySingleResourceElementType', + type: { + name: 'Composite', + class_name: 'TopologySingleResource' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource.rb new file mode 100644 index 000000000..dd5837cc1 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource.rb @@ -0,0 +1,154 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class TopologySingleResource + + include MsRestAzure + + # @return [String] Azure resource id + attr_accessor :resource_id + + # @return [String] The security severity of the resource + attr_accessor :severity + + # @return [Boolean] Indicates if the resource has security + # recommendations + attr_accessor :recommendations_exist + + # @return [String] Indicates the resource connectivity level to the + # Internet (InternetFacing, Internal ,etc.) + attr_accessor :network_zones + + # @return [Integer] Score of the resource based on its security severity + attr_accessor :topology_score + + # @return [String] The location of this resource + attr_accessor :location + + # @return [Array] Azure resources connected + # to this resource which are in higher level in the topology view + attr_accessor :parents + + # @return [Array] Azure resources connected + # to this resource which are in lower level in the topology view + attr_accessor :children + + + # + # Mapper for TopologySingleResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopologySingleResource', + type: { + name: 'Composite', + class_name: 'TopologySingleResource', + model_properties: { + resource_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'resourceId', + type: { + name: 'String' + } + }, + severity: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'severity', + type: { + name: 'String' + } + }, + recommendations_exist: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'recommendationsExist', + type: { + name: 'Boolean' + } + }, + network_zones: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'networkZones', + type: { + name: 'String' + } + }, + topology_score: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'topologyScore', + type: { + name: 'Number' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + parents: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'parents', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TopologySingleResourceParentElementType', + type: { + name: 'Composite', + class_name: 'TopologySingleResourceParent' + } + } + } + }, + children: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'children', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TopologySingleResourceChildElementType', + type: { + name: 'Composite', + class_name: 'TopologySingleResourceChild' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_child.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_child.rb new file mode 100644 index 000000000..c3922e934 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_child.rb @@ -0,0 +1,49 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class TopologySingleResourceChild + + include MsRestAzure + + # @return [String] Azure resource id which serves as child resource in + # topology view + attr_accessor :resource_id + + + # + # Mapper for TopologySingleResourceChild class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopologySingleResourceChild', + type: { + name: 'Composite', + class_name: 'TopologySingleResourceChild', + model_properties: { + resource_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'resourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_parent.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_parent.rb new file mode 100644 index 000000000..bdc3e546a --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_parent.rb @@ -0,0 +1,49 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Model object. + # + # + class TopologySingleResourceParent + + include MsRestAzure + + # @return [String] Azure resource id which serves as parent resource in + # topology view + attr_accessor :resource_id + + + # + # Mapper for TopologySingleResourceParent class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopologySingleResourceParent', + type: { + name: 'Composite', + class_name: 'TopologySingleResourceParent', + model_properties: { + resource_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'resourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/tracked_resource.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/tracked_resource.rb new file mode 100644 index 000000000..19a95a202 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/tracked_resource.rb @@ -0,0 +1,126 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Describes an Azure tracked resource. + # + class TrackedResource + + include MsRestAzure + + # @return [String] Resource Id + attr_accessor :id + + # @return [String] Resource name + attr_accessor :name + + # @return [String] Resource type + attr_accessor :type + + # @return [String] Location where the resource is stored + attr_accessor :location + + # @return [String] Kind of the resource + attr_accessor :kind + + # @return [String] Entity tag is used for comparing two or more entities + # from the same requested resource. + attr_accessor :etag + + # @return [Hash{String => String}] A list of key value pairs that + # describe the resource. + attr_accessor :tags + + + # + # Mapper for TrackedResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TrackedResource', + type: { + name: 'Composite', + class_name: 'TrackedResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + type: { + name: 'String' + } + }, + etag: { + client_side_validation: true, + required: false, + serialized_name: 'etag', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/transport_protocol.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/transport_protocol.rb new file mode 100644 index 000000000..1517ce782 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/transport_protocol.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for TransportProtocol + # + module TransportProtocol + TCP = "TCP" + UDP = "UDP" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/user_impact.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/user_impact.rb new file mode 100644 index 000000000..a6fabe7ea --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/user_impact.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Defines values for UserImpact + # + module UserImpact + Low = "Low" + Moderate = "Moderate" + High = "High" + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/user_recommendation.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/user_recommendation.rb new file mode 100644 index 000000000..2acaa1912 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/user_recommendation.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Represents a user that is recommended to be allowed for a certain rule + # + class UserRecommendation + + include MsRestAzure + + # @return [String] Represents a user that is recommended to be allowed + # for a certain rule + attr_accessor :username + + # @return [Enum] Possible values include: 'Recommended', 'Add', 'Remove' + attr_accessor :recommendation_action + + + # + # Mapper for UserRecommendation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UserRecommendation', + type: { + name: 'Composite', + class_name: 'UserRecommendation', + model_properties: { + username: { + client_side_validation: true, + required: false, + serialized_name: 'username', + type: { + name: 'String' + } + }, + recommendation_action: { + client_side_validation: true, + required: false, + serialized_name: 'recommendationAction', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/vm_recommendation.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/vm_recommendation.rb new file mode 100644 index 000000000..e6bdf2284 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/models/vm_recommendation.rb @@ -0,0 +1,81 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + module Models + # + # Represents a machine that is part of a VM/server group + # + class VmRecommendation + + include MsRestAzure + + # @return [Enum] Possible values include: 'Configured', 'NotConfigured', + # 'InProgress', 'Failed', 'NoStatus' + attr_accessor :configuration_status + + # @return [Enum] Possible values include: 'Recommended', 'Add', 'Remove' + attr_accessor :recommendation_action + + # @return [String] + attr_accessor :resource_id + + # @return [Enum] Possible values include: 'Supported', 'NotSupported', + # 'Unknown' + attr_accessor :enforcement_support + + + # + # Mapper for VmRecommendation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'VmRecommendation', + type: { + name: 'Composite', + class_name: 'VmRecommendation', + model_properties: { + configuration_status: { + client_side_validation: true, + required: false, + serialized_name: 'configurationStatus', + type: { + name: 'String' + } + }, + recommendation_action: { + client_side_validation: true, + required: false, + serialized_name: 'recommendationAction', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'resourceId', + type: { + name: 'String' + } + }, + enforcement_support: { + client_side_validation: true, + required: false, + serialized_name: 'enforcementSupport', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/module_definition.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/module_definition.rb new file mode 100644 index 000000000..31be708ea --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/module_definition.rb @@ -0,0 +1,9 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::Security end +module Azure::Security::Mgmt end +module Azure::Security::Mgmt::V2020_01_01 end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/security_center.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/security_center.rb new file mode 100644 index 000000000..a6835da59 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/security_center.rb @@ -0,0 +1,172 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + # + # A service client - single point of access to the REST API. + # + class SecurityCenter < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] API version for the operation + attr_reader :api_version + + # @return [String] Azure subscription ID + attr_accessor :subscription_id + + # @return [String] The location where ASC stores the data of the + # subscription. can be retrieved from Get locations + attr_accessor :asc_location + + # @return [String] The preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] The retry timeout in seconds for Long Running + # Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] Whether a unique x-ms-client-request-id should be + # generated. When set to true a unique x-ms-client-request-id value is + # generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [AdaptiveNetworkHardenings] adaptive_network_hardenings + attr_reader :adaptive_network_hardenings + + # @return [AllowedConnections] allowed_connections + attr_reader :allowed_connections + + # @return [AdaptiveApplicationControls] adaptive_application_controls + attr_reader :adaptive_application_controls + + # @return [AssessmentsMetadata] assessments_metadata + attr_reader :assessments_metadata + + # @return [Assessments] assessments + attr_reader :assessments + + # @return [DiscoveredSecuritySolutions] discovered_security_solutions + attr_reader :discovered_security_solutions + + # @return [ExternalSecuritySolutions] external_security_solutions + attr_reader :external_security_solutions + + # @return [JitNetworkAccessPolicies] jit_network_access_policies + attr_reader :jit_network_access_policies + + # @return [ServerVulnerabilityAssessmentOperations] + # server_vulnerability_assessment_operations + attr_reader :server_vulnerability_assessment_operations + + # @return [Topology] topology + attr_reader :topology + + # + # Creates initializes a new instance of the SecurityCenter class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @adaptive_network_hardenings = AdaptiveNetworkHardenings.new(self) + @allowed_connections = AllowedConnections.new(self) + @adaptive_application_controls = AdaptiveApplicationControls.new(self) + @assessments_metadata = AssessmentsMetadata.new(self) + @assessments = Assessments.new(self) + @discovered_security_solutions = DiscoveredSecuritySolutions.new(self) + @external_security_solutions = ExternalSecuritySolutions.new(self) + @jit_network_access_policies = JitNetworkAccessPolicies.new(self) + @server_vulnerability_assessment_operations = ServerVulnerabilityAssessmentOperations.new(self) + @topology = Topology.new(self) + @api_version = '2020-01-01' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) + @request_headers['Content-Type'] = options[:headers]['Content-Type'] + end + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_security' + sdk_information = "#{sdk_information}/0.18.2" + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/server_vulnerability_assessment_operations.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/server_vulnerability_assessment_operations.rb new file mode 100644 index 000000000..50a27c602 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/server_vulnerability_assessment_operations.rb @@ -0,0 +1,462 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class ServerVulnerabilityAssessmentOperations + include MsRestAzure + + # + # Creates and initializes a new instance of the ServerVulnerabilityAssessmentOperations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # Gets a list of server vulnerability assessment onboarding statuses on a given + # resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ServerVulnerabilityAssessmentsList] operation results. + # + def list_by_extended_resource(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + response = list_by_extended_resource_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a list of server vulnerability assessment onboarding statuses on a given + # resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_extended_resource_with_http_info(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + list_by_extended_resource_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:custom_headers).value! + end + + # + # Gets a list of server vulnerability assessment onboarding statuses on a given + # resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_extended_resource_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'resource_namespace is nil' if resource_namespace.nil? + fail ArgumentError, 'resource_type is nil' if resource_type.nil? + fail ArgumentError, 'resource_name is nil' if resource_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceNamespace' => resource_namespace,'resourceType' => resource_type,'resourceName' => resource_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::ServerVulnerabilityAssessmentsList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a server vulnerability assessment onboarding statuses on a given + # resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ServerVulnerabilityAssessment] operation results. + # + def get(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + response = get_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a server vulnerability assessment onboarding statuses on a given + # resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + get_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:custom_headers).value! + end + + # + # Gets a server vulnerability assessment onboarding statuses on a given + # resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'resource_namespace is nil' if resource_namespace.nil? + fail ArgumentError, 'resource_type is nil' if resource_type.nil? + fail ArgumentError, 'resource_name is nil' if resource_name.nil? + server_vulnerability_assessment = 'default' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceNamespace' => resource_namespace,'resourceType' => resource_type,'resourceName' => resource_name,'serverVulnerabilityAssessment' => server_vulnerability_assessment}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::ServerVulnerabilityAssessment.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creating a server vulnerability assessment on a resource, which will onboard + # a resource for having a vulnerability assessment on it + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ServerVulnerabilityAssessment] operation results. + # + def create_or_update(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + response = create_or_update_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Creating a server vulnerability assessment on a resource, which will onboard + # a resource for having a vulnerability assessment on it + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def create_or_update_with_http_info(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + create_or_update_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:custom_headers).value! + end + + # + # Creating a server vulnerability assessment on a resource, which will onboard + # a resource for having a vulnerability assessment on it + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def create_or_update_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'resource_namespace is nil' if resource_namespace.nil? + fail ArgumentError, 'resource_type is nil' if resource_type.nil? + fail ArgumentError, 'resource_name is nil' if resource_name.nil? + server_vulnerability_assessment = 'default' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceNamespace' => resource_namespace,'resourceType' => resource_type,'resourceName' => resource_name,'serverVulnerabilityAssessment' => server_vulnerability_assessment}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 202 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::ServerVulnerabilityAssessment.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Removing server vulnerability assessment from a resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + response = delete_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:custom_headers).value! + nil + end + + # + # Removing server vulnerability assessment from a resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def delete_with_http_info(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + delete_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:custom_headers).value! + end + + # + # Removing server vulnerability assessment from a resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param resource_namespace [String] The Namespace of the resource. + # @param resource_type [String] The type of the resource. + # @param resource_name [String] Name of the resource. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def delete_async(resource_group_name, resource_namespace, resource_type, resource_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, 'resource_namespace is nil' if resource_namespace.nil? + fail ArgumentError, 'resource_type is nil' if resource_type.nil? + fail ArgumentError, 'resource_name is nil' if resource_name.nil? + server_vulnerability_assessment = 'default' + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceNamespace' => resource_namespace,'resourceType' => resource_type,'resourceName' => resource_name,'serverVulnerabilityAssessment' => server_vulnerability_assessment}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/topology.rb b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/topology.rb new file mode 100644 index 000000000..26ebe4d48 --- /dev/null +++ b/management/azure_mgmt_security/lib/2020-01-01/generated/azure_mgmt_security/topology.rb @@ -0,0 +1,530 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Security::Mgmt::V2020_01_01 + # + # API spec for Microsoft.Security (Azure Security Center) resource provider + # + class Topology + include MsRestAzure + + # + # Creates and initializes a new instance of the Topology class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SecurityCenter] reference to the SecurityCenter + attr_reader :client + + # + # Gets a list that allows to build a topology view of a subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers:nil) + first_page = list_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Gets a list that allows to build a topology view of a subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers:nil) + list_async(custom_headers:custom_headers).value! + end + + # + # Gets a list that allows to build a topology view of a subscription. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::TopologyList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list that allows to build a topology view of a subscription and + # location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_home_region(custom_headers:nil) + first_page = list_by_home_region_as_lazy(custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Gets a list that allows to build a topology view of a subscription and + # location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_home_region_with_http_info(custom_headers:nil) + list_by_home_region_async(custom_headers:custom_headers).value! + end + + # + # Gets a list that allows to build a topology view of a subscription and + # location. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_home_region_async(custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::TopologyList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a specific topology component. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param topology_resource_name [String] Name of a topology resources + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopologyResource] operation results. + # + def get(resource_group_name, topology_resource_name, custom_headers:nil) + response = get_async(resource_group_name, topology_resource_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a specific topology component. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param topology_resource_name [String] Name of a topology resources + # collection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, topology_resource_name, custom_headers:nil) + get_async(resource_group_name, topology_resource_name, custom_headers:custom_headers).value! + end + + # + # Gets a specific topology component. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. The name is case insensitive. + # @param topology_resource_name [String] Name of a topology resources + # collection. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, topology_resource_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 + fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? + fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil? + fail ArgumentError, 'topology_resource_name is nil' if topology_resource_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location,'topologyResourceName' => topology_resource_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::TopologyResource.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list that allows to build a topology view of a subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopologyList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a list that allows to build a topology view of a subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers:nil) + list_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Gets a list that allows to build a topology view of a subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::TopologyList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list that allows to build a topology view of a subscription and + # location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopologyList] operation results. + # + def list_by_home_region_next(next_page_link, custom_headers:nil) + response = list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a list that allows to build a topology view of a subscription and + # location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_home_region_next_with_http_info(next_page_link, custom_headers:nil) + list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Gets a list that allows to build a topology view of a subscription and + # location. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_home_region_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::TopologyList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a list that allows to build a topology view of a subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopologyList] which provide lazy access to pages of the response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # Gets a list that allows to build a topology view of a subscription and + # location. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopologyList] which provide lazy access to pages of the response. + # + def list_by_home_region_as_lazy(custom_headers:nil) + response = list_by_home_region_async(custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_home_region_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_security/lib/azure_mgmt_security.rb b/management/azure_mgmt_security/lib/azure_mgmt_security.rb index e43ba10ac..79ecbbcae 100644 --- a/management/azure_mgmt_security/lib/azure_mgmt_security.rb +++ b/management/azure_mgmt_security/lib/azure_mgmt_security.rb @@ -3,10 +3,12 @@ # Licensed under the MIT License. See License.txt in the project root for license information. require '2018-06-01/generated/azure_mgmt_security' +require '2020-01-01-preview/generated/azure_mgmt_security' require '2017-08-01-preview/generated/azure_mgmt_security' require '2019-01-01-preview/generated/azure_mgmt_security' require '2017-08-01/generated/azure_mgmt_security' require '2015-06-01-preview/generated/azure_mgmt_security' require '2019-01-01/generated/azure_mgmt_security' +require '2020-01-01/generated/azure_mgmt_security' require '2019-08-01/generated/azure_mgmt_security' require 'profiles/latest/security_latest_profile_client' diff --git a/management/azure_mgmt_security/lib/profiles/latest/modules/security_profile_module.rb b/management/azure_mgmt_security/lib/profiles/latest/modules/security_profile_module.rb index b171f5c5c..3380c04b5 100644 --- a/management/azure_mgmt_security/lib/profiles/latest/modules/security_profile_module.rb +++ b/management/azure_mgmt_security/lib/profiles/latest/modules/security_profile_module.rb @@ -6,16 +6,9 @@ require 'azure_mgmt_security' module Azure::Security::Profiles::Latest module Mgmt - AdaptiveNetworkHardenings = Azure::Security::Mgmt::V2015_06_01_preview::AdaptiveNetworkHardenings - AllowedConnections = Azure::Security::Mgmt::V2015_06_01_preview::AllowedConnections - AdaptiveApplicationControls = Azure::Security::Mgmt::V2015_06_01_preview::AdaptiveApplicationControls - DiscoveredSecuritySolutions = Azure::Security::Mgmt::V2015_06_01_preview::DiscoveredSecuritySolutions - ExternalSecuritySolutions = Azure::Security::Mgmt::V2015_06_01_preview::ExternalSecuritySolutions - JitNetworkAccessPolicies = Azure::Security::Mgmt::V2015_06_01_preview::JitNetworkAccessPolicies Locations = Azure::Security::Mgmt::V2015_06_01_preview::Locations Operations = Azure::Security::Mgmt::V2015_06_01_preview::Operations Tasks = Azure::Security::Mgmt::V2015_06_01_preview::Tasks - Topology = Azure::Security::Mgmt::V2015_06_01_preview::Topology AdvancedThreatProtection = Azure::Security::Mgmt::V2017_08_01_preview::AdvancedThreatProtection AutoProvisioningSettings = Azure::Security::Mgmt::V2017_08_01_preview::AutoProvisioningSettings Compliances = Azure::Security::Mgmt::V2017_08_01_preview::Compliances @@ -28,7 +21,6 @@ module Azure::Security::Profiles::Latest RegulatoryComplianceStandards = Azure::Security::Mgmt::V2019_01_01_preview::RegulatoryComplianceStandards RegulatoryComplianceControls = Azure::Security::Mgmt::V2019_01_01_preview::RegulatoryComplianceControls RegulatoryComplianceAssessments = Azure::Security::Mgmt::V2019_01_01_preview::RegulatoryComplianceAssessments - ServerVulnerabilityAssessmentOperations = Azure::Security::Mgmt::V2019_01_01_preview::ServerVulnerabilityAssessmentOperations Alerts = Azure::Security::Mgmt::V2019_01_01::Alerts Settings = Azure::Security::Mgmt::V2019_01_01::Settings IoTSecuritySolutionsAnalytics = Azure::Security::Mgmt::V2019_08_01::IoTSecuritySolutionsAnalytics @@ -39,72 +31,26 @@ module Azure::Security::Profiles::Latest IoTSecuritySolutions = Azure::Security::Mgmt::V2019_08_01::IoTSecuritySolutions IoTSecuritySolutionsResourceGroup = Azure::Security::Mgmt::V2019_08_01::IoTSecuritySolutionsResourceGroup IotSecuritySolution = Azure::Security::Mgmt::V2019_08_01::IotSecuritySolution + AdaptiveNetworkHardenings = Azure::Security::Mgmt::V2020_01_01::AdaptiveNetworkHardenings + AllowedConnections = Azure::Security::Mgmt::V2020_01_01::AllowedConnections + AdaptiveApplicationControls = Azure::Security::Mgmt::V2020_01_01::AdaptiveApplicationControls + AssessmentsMetadata = Azure::Security::Mgmt::V2020_01_01::AssessmentsMetadata + Assessments = Azure::Security::Mgmt::V2020_01_01::Assessments + DiscoveredSecuritySolutions = Azure::Security::Mgmt::V2020_01_01::DiscoveredSecuritySolutions + ExternalSecuritySolutions = Azure::Security::Mgmt::V2020_01_01::ExternalSecuritySolutions + JitNetworkAccessPolicies = Azure::Security::Mgmt::V2020_01_01::JitNetworkAccessPolicies + ServerVulnerabilityAssessmentOperations = Azure::Security::Mgmt::V2020_01_01::ServerVulnerabilityAssessmentOperations + Topology = Azure::Security::Mgmt::V2020_01_01::Topology module Models - ExternalSecuritySolutionList = Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionList - Rule = Azure::Security::Mgmt::V2015_06_01_preview::Models::Rule - EffectiveNetworkSecurityGroups = Azure::Security::Mgmt::V2015_06_01_preview::Models::EffectiveNetworkSecurityGroups SecurityTaskList = Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskList - AdaptiveNetworkHardeningsList = Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardeningsList - TopologyList = Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologyList - AdaptiveNetworkHardeningEnforceRequest = Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardeningEnforceRequest SecurityTaskParameters = Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskParameters - TopologyResource = Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologyResource - TopologySingleResource = Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResource - ConnectedWorkspace = Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectedWorkspace - ConnectableResource = Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectableResource - AadSolutionProperties = Azure::Security::Mgmt::V2015_06_01_preview::Models::AadSolutionProperties - AllowedConnectionsList = Azure::Security::Mgmt::V2015_06_01_preview::Models::AllowedConnectionsList - TopologySingleResourceChild = Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResourceChild - AppWhitelistingIssueSummary = Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingIssueSummary - ExternalSecuritySolutionKind1 = Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionKind1 - PublisherInfo = Azure::Security::Mgmt::V2015_06_01_preview::Models::PublisherInfo - ExternalSecuritySolutionProperties = Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionProperties - PathRecommendation = Azure::Security::Mgmt::V2015_06_01_preview::Models::PathRecommendation - AadConnectivityState1 = Azure::Security::Mgmt::V2015_06_01_preview::Models::AadConnectivityState1 - AppWhitelistingGroups = Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingGroups - JitNetworkAccessPortRule = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPortRule - DiscoveredSecuritySolution = Azure::Security::Mgmt::V2015_06_01_preview::Models::DiscoveredSecuritySolution - JitNetworkAccessPolicyVirtualMachine = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyVirtualMachine - ExternalSecuritySolution = Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolution - JitNetworkAccessRequestPort = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequestPort - JitNetworkAccessRequestVirtualMachine = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequestVirtualMachine - TopologySingleResourceParent = Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResourceParent - JitNetworkAccessRequest = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequest - AllowedConnectionsResource = Azure::Security::Mgmt::V2015_06_01_preview::Models::AllowedConnectionsResource - JitNetworkAccessPolicy = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicy - VmRecommendation = Azure::Security::Mgmt::V2015_06_01_preview::Models::VmRecommendation - JitNetworkAccessPoliciesList = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPoliciesList - AppWhitelistingGroup = Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingGroup - JitNetworkAccessPolicyInitiatePort = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiatePort - DiscoveredSecuritySolutionList = Azure::Security::Mgmt::V2015_06_01_preview::Models::DiscoveredSecuritySolutionList - JitNetworkAccessPolicyInitiateVirtualMachine = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiateVirtualMachine - JitNetworkAccessPolicyInitiateRequest = Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiateRequest - Location = Azure::Security::Mgmt::V2015_06_01_preview::Models::Location - Kind = Azure::Security::Mgmt::V2015_06_01_preview::Models::Kind AppWhitelistingPutGroupData = Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingPutGroupData AscLocationList = Azure::Security::Mgmt::V2015_06_01_preview::Models::AscLocationList - ConnectedResource = Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectedResource OperationDisplay = Azure::Security::Mgmt::V2015_06_01_preview::Models::OperationDisplay OperationList = Azure::Security::Mgmt::V2015_06_01_preview::Models::OperationList - UserRecommendation = Azure::Security::Mgmt::V2015_06_01_preview::Models::UserRecommendation Operation = Azure::Security::Mgmt::V2015_06_01_preview::Models::Operation - AdaptiveNetworkHardening = Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardening - CefSolutionProperties = Azure::Security::Mgmt::V2015_06_01_preview::Models::CefSolutionProperties - CefExternalSecuritySolution = Azure::Security::Mgmt::V2015_06_01_preview::Models::CefExternalSecuritySolution - AtaSolutionProperties = Azure::Security::Mgmt::V2015_06_01_preview::Models::AtaSolutionProperties - AtaExternalSecuritySolution = Azure::Security::Mgmt::V2015_06_01_preview::Models::AtaExternalSecuritySolution - AadExternalSecuritySolution = Azure::Security::Mgmt::V2015_06_01_preview::Models::AadExternalSecuritySolution SecurityTask = Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTask - Direction = Azure::Security::Mgmt::V2015_06_01_preview::Models::Direction - TransportProtocol = Azure::Security::Mgmt::V2015_06_01_preview::Models::TransportProtocol - SecurityFamily = Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityFamily - AadConnectivityState = Azure::Security::Mgmt::V2015_06_01_preview::Models::AadConnectivityState - ExternalSecuritySolutionKind = Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionKind - Protocol = Azure::Security::Mgmt::V2015_06_01_preview::Models::Protocol - Status = Azure::Security::Mgmt::V2015_06_01_preview::Models::Status - StatusReason = Azure::Security::Mgmt::V2015_06_01_preview::Models::StatusReason - ConnectionType = Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectionType InformationProtectionKeyword = Azure::Security::Mgmt::V2017_08_01_preview::Models::InformationProtectionKeyword InformationType = Azure::Security::Mgmt::V2017_08_01_preview::Models::InformationType WorkspaceSettingList = Azure::Security::Mgmt::V2017_08_01_preview::Models::WorkspaceSettingList @@ -141,11 +87,9 @@ module Azure::Security::Profiles::Latest RegulatoryComplianceAssessmentList = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceAssessmentList RegulatoryComplianceControlList = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceControlList RegulatoryComplianceStandardList = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceStandardList - ServerVulnerabilityAssessmentsList = Azure::Security::Mgmt::V2019_01_01_preview::Models::ServerVulnerabilityAssessmentsList RegulatoryComplianceStandard = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceStandard RegulatoryComplianceControl = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceControl RegulatoryComplianceAssessment = Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceAssessment - ServerVulnerabilityAssessment = Azure::Security::Mgmt::V2019_01_01_preview::Models::ServerVulnerabilityAssessment State = Azure::Security::Mgmt::V2019_01_01_preview::Models::State AlertEntity = Azure::Security::Mgmt::V2019_01_01::Models::AlertEntity SettingsList = Azure::Security::Mgmt::V2019_01_01::Models::SettingsList @@ -169,14 +113,12 @@ module Azure::Security::Profiles::Latest IoTSecuritySolutionAnalyticsModelList = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionAnalyticsModelList IoTSecuritySolutionsList = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionsList IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem - Resource = Azure::Security::Mgmt::V2019_08_01::Models::Resource IoTSecurityDeviceAlertsList = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecurityDeviceAlertsList IoTSecurityAlertedDevicesList = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecurityAlertedDevicesList UserDefinedResourcesProperties = Azure::Security::Mgmt::V2019_08_01::Models::UserDefinedResourcesProperties IoTSecurityAggregatedAlert = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecurityAggregatedAlert RecommendationConfigurationProperties = Azure::Security::Mgmt::V2019_08_01::Models::RecommendationConfigurationProperties IoTSecuritySolutionAnalyticsModel = Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionAnalyticsModel - AscLocation = Azure::Security::Mgmt::V2019_08_01::Models::AscLocation UpdateIotSecuritySolutionData = Azure::Security::Mgmt::V2019_08_01::Models::UpdateIotSecuritySolutionData ReportedSeverity = Azure::Security::Mgmt::V2019_08_01::Models::ReportedSeverity SecuritySolutionStatus = Azure::Security::Mgmt::V2019_08_01::Models::SecuritySolutionStatus @@ -184,13 +126,97 @@ module Azure::Security::Profiles::Latest DataSource = Azure::Security::Mgmt::V2019_08_01::Models::DataSource RecommendationType = Azure::Security::Mgmt::V2019_08_01::Models::RecommendationType RecommendationConfigStatus = Azure::Security::Mgmt::V2019_08_01::Models::RecommendationConfigStatus + ResourceDetails = Azure::Security::Mgmt::V2020_01_01::Models::ResourceDetails + Rule = Azure::Security::Mgmt::V2020_01_01::Models::Rule + AssessmentStatus = Azure::Security::Mgmt::V2020_01_01::Models::AssessmentStatus + EffectiveNetworkSecurityGroups = Azure::Security::Mgmt::V2020_01_01::Models::EffectiveNetworkSecurityGroups + AdaptiveNetworkHardeningsList = Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardeningsList + JitNetworkAccessPolicy = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicy + JitNetworkAccessPolicyInitiatePort = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiatePort + AssessmentLinks = Azure::Security::Mgmt::V2020_01_01::Models::AssessmentLinks + Location = Azure::Security::Mgmt::V2020_01_01::Models::Location + SecurityAssessmentPartnerData = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentPartnerData + ETag = Azure::Security::Mgmt::V2020_01_01::Models::ETag + TopologyList = Azure::Security::Mgmt::V2020_01_01::Models::TopologyList + Resource = Azure::Security::Mgmt::V2020_01_01::Models::Resource + SecurityAssessmentList = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentList + ConnectedResource = Azure::Security::Mgmt::V2020_01_01::Models::ConnectedResource + TopologyResource = Azure::Security::Mgmt::V2020_01_01::Models::TopologyResource + AllowedConnectionsResource = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsResource + TopologySingleResource = Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResource + ProtectionMode = Azure::Security::Mgmt::V2020_01_01::Models::ProtectionMode + DiscoveredSecuritySolution = Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolution + VmRecommendation = Azure::Security::Mgmt::V2020_01_01::Models::VmRecommendation + DiscoveredSecuritySolutionList = Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolutionList + UserRecommendation = Azure::Security::Mgmt::V2020_01_01::Models::UserRecommendation + ExternalSecuritySolution = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolution + AppWhitelistingGroup = Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroup + ExternalSecuritySolutionList = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionList + SecurityAssessmentMetadataPartnerData = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataPartnerData + TopologySingleResourceChild = Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResourceChild + JitNetworkAccessPoliciesList = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList + TopologySingleResourceParent = Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResourceParent + AdaptiveNetworkHardeningEnforceRequest = Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardeningEnforceRequest + ServerVulnerabilityAssessmentsList = Azure::Security::Mgmt::V2020_01_01::Models::ServerVulnerabilityAssessmentsList + Kind = Azure::Security::Mgmt::V2020_01_01::Models::Kind + JitNetworkAccessPolicyInitiateRequest = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiateRequest + ConnectedWorkspace = Azure::Security::Mgmt::V2020_01_01::Models::ConnectedWorkspace + AllowedConnectionsList = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList + AadSolutionProperties = Azure::Security::Mgmt::V2020_01_01::Models::AadSolutionProperties + PublisherInfo = Azure::Security::Mgmt::V2020_01_01::Models::PublisherInfo + JitNetworkAccessPolicyInitiateVirtualMachine = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiateVirtualMachine + AppWhitelistingGroups = Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroups + ExternalSecuritySolutionKind1 = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionKind1 + SecurityAssessmentMetadataList = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataList + ExternalSecuritySolutionProperties = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionProperties + Tags = Azure::Security::Mgmt::V2020_01_01::Models::Tags + AadConnectivityState1 = Azure::Security::Mgmt::V2020_01_01::Models::AadConnectivityState1 + AppWhitelistingIssueSummary = Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingIssueSummary + JitNetworkAccessPortRule = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPortRule + SecurityAssessmentMetadataProperties = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataProperties + JitNetworkAccessPolicyVirtualMachine = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyVirtualMachine + ConnectableResource = Azure::Security::Mgmt::V2020_01_01::Models::ConnectableResource + JitNetworkAccessRequestPort = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequestPort + TrackedResource = Azure::Security::Mgmt::V2020_01_01::Models::TrackedResource + JitNetworkAccessRequestVirtualMachine = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequestVirtualMachine + PathRecommendation = Azure::Security::Mgmt::V2020_01_01::Models::PathRecommendation + JitNetworkAccessRequest = Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequest + AdaptiveNetworkHardening = Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardening + AscLocation = Azure::Security::Mgmt::V2020_01_01::Models::AscLocation + SecurityAssessmentMetadata = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadata + SecurityAssessment = Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessment + OnPremiseResourceDetails = Azure::Security::Mgmt::V2020_01_01::Models::OnPremiseResourceDetails + AzureResourceDetails = Azure::Security::Mgmt::V2020_01_01::Models::AzureResourceDetails + CefSolutionProperties = Azure::Security::Mgmt::V2020_01_01::Models::CefSolutionProperties + CefExternalSecuritySolution = Azure::Security::Mgmt::V2020_01_01::Models::CefExternalSecuritySolution + AtaSolutionProperties = Azure::Security::Mgmt::V2020_01_01::Models::AtaSolutionProperties + AtaExternalSecuritySolution = Azure::Security::Mgmt::V2020_01_01::Models::AtaExternalSecuritySolution + AadExternalSecuritySolution = Azure::Security::Mgmt::V2020_01_01::Models::AadExternalSecuritySolution + ServerVulnerabilityAssessment = Azure::Security::Mgmt::V2020_01_01::Models::ServerVulnerabilityAssessment + Direction = Azure::Security::Mgmt::V2020_01_01::Models::Direction + TransportProtocol = Azure::Security::Mgmt::V2020_01_01::Models::TransportProtocol + Category = Azure::Security::Mgmt::V2020_01_01::Models::Category + Severity = Azure::Security::Mgmt::V2020_01_01::Models::Severity + UserImpact = Azure::Security::Mgmt::V2020_01_01::Models::UserImpact + ImplementationEffort = Azure::Security::Mgmt::V2020_01_01::Models::ImplementationEffort + Threats = Azure::Security::Mgmt::V2020_01_01::Models::Threats + AssessmentType = Azure::Security::Mgmt::V2020_01_01::Models::AssessmentType + AssessmentStatusCode = Azure::Security::Mgmt::V2020_01_01::Models::AssessmentStatusCode + SecurityFamily = Azure::Security::Mgmt::V2020_01_01::Models::SecurityFamily + AadConnectivityState = Azure::Security::Mgmt::V2020_01_01::Models::AadConnectivityState + ExternalSecuritySolutionKind = Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionKind + Protocol = Azure::Security::Mgmt::V2020_01_01::Models::Protocol + Status = Azure::Security::Mgmt::V2020_01_01::Models::Status + StatusReason = Azure::Security::Mgmt::V2020_01_01::Models::StatusReason + ConnectionType = Azure::Security::Mgmt::V2020_01_01::Models::ConnectionType + ExpandEnum = Azure::Security::Mgmt::V2020_01_01::Models::ExpandEnum end # # SecurityManagementClass # class SecurityManagementClass - attr_reader :adaptive_network_hardenings, :allowed_connections, :adaptive_application_controls, :discovered_security_solutions, :external_security_solutions, :jit_network_access_policies, :locations, :operations, :tasks, :topology, :advanced_threat_protection, :auto_provisioning_settings, :compliances, :device_security_groups, :information_protection_policies, :security_contacts, :workspace_settings, :compliance_results, :pricings, :regulatory_compliance_standards, :regulatory_compliance_controls, :regulatory_compliance_assessments, :server_vulnerability_assessment_operations, :alerts, :settings, :io_tsecurity_solutions_analytics, :io_tsecurity_solutions_analytics_aggregated_alerts, :io_tsecurity_solutions_analytics_aggregated_alert, :io_tsecurity_solutions_analytics_recommendation, :io_tsecurity_solutions_analytics_recommendations, :io_tsecurity_solutions, :io_tsecurity_solutions_resource_group, :iot_security_solution, :configurable, :base_url, :options, :model_classes + attr_reader :locations, :operations, :tasks, :advanced_threat_protection, :auto_provisioning_settings, :compliances, :device_security_groups, :information_protection_policies, :security_contacts, :workspace_settings, :compliance_results, :pricings, :regulatory_compliance_standards, :regulatory_compliance_controls, :regulatory_compliance_assessments, :alerts, :settings, :io_tsecurity_solutions_analytics, :io_tsecurity_solutions_analytics_aggregated_alerts, :io_tsecurity_solutions_analytics_aggregated_alert, :io_tsecurity_solutions_analytics_recommendation, :io_tsecurity_solutions_analytics_recommendations, :io_tsecurity_solutions, :io_tsecurity_solutions_resource_group, :iot_security_solution, :adaptive_network_hardenings, :allowed_connections, :adaptive_application_controls, :assessments_metadata, :assessments, :discovered_security_solutions, :external_security_solutions, :jit_network_access_policies, :server_vulnerability_assessment_operations, :topology, :configurable, :base_url, :options, :model_classes def initialize(options = {}) if options.is_a?(Hash) && options.length == 0 @@ -210,16 +236,9 @@ module Azure::Security::Profiles::Latest @client_0.subscription_id = configurable.subscription_id end add_telemetry(@client_0) - @adaptive_network_hardenings = @client_0.adaptive_network_hardenings - @allowed_connections = @client_0.allowed_connections - @adaptive_application_controls = @client_0.adaptive_application_controls - @discovered_security_solutions = @client_0.discovered_security_solutions - @external_security_solutions = @client_0.external_security_solutions - @jit_network_access_policies = @client_0.jit_network_access_policies @locations = @client_0.locations @operations = @client_0.operations @tasks = @client_0.tasks - @topology = @client_0.topology @client_1 = Azure::Security::Mgmt::V2017_08_01_preview::SecurityCenter.new(configurable.credentials, base_url, options) if(@client_1.respond_to?(:subscription_id)) @@ -256,7 +275,6 @@ module Azure::Security::Profiles::Latest @regulatory_compliance_standards = @client_4.regulatory_compliance_standards @regulatory_compliance_controls = @client_4.regulatory_compliance_controls @regulatory_compliance_assessments = @client_4.regulatory_compliance_assessments - @server_vulnerability_assessment_operations = @client_4.server_vulnerability_assessment_operations @client_5 = Azure::Security::Mgmt::V2019_01_01::SecurityCenter.new(configurable.credentials, base_url, options) if(@client_5.respond_to?(:subscription_id)) @@ -280,6 +298,22 @@ module Azure::Security::Profiles::Latest @io_tsecurity_solutions_resource_group = @client_6.io_tsecurity_solutions_resource_group @iot_security_solution = @client_6.iot_security_solution + @client_7 = Azure::Security::Mgmt::V2020_01_01::SecurityCenter.new(configurable.credentials, base_url, options) + if(@client_7.respond_to?(:subscription_id)) + @client_7.subscription_id = configurable.subscription_id + end + add_telemetry(@client_7) + @adaptive_network_hardenings = @client_7.adaptive_network_hardenings + @allowed_connections = @client_7.allowed_connections + @adaptive_application_controls = @client_7.adaptive_application_controls + @assessments_metadata = @client_7.assessments_metadata + @assessments = @client_7.assessments + @discovered_security_solutions = @client_7.discovered_security_solutions + @external_security_solutions = @client_7.external_security_solutions + @jit_network_access_policies = @client_7.jit_network_access_policies + @server_vulnerability_assessment_operations = @client_7.server_vulnerability_assessment_operations + @topology = @client_7.topology + @model_classes = ModelClasses.new end @@ -289,7 +323,9 @@ module Azure::Security::Profiles::Latest end def method_missing(method, *args) - if @client_6.respond_to?method + if @client_7.respond_to?method + @client_7.send(method, *args) + elsif @client_6.respond_to?method @client_6.send(method, *args) elsif @client_5.respond_to?method @client_5.send(method, *args) @@ -311,198 +347,30 @@ module Azure::Security::Profiles::Latest end class ModelClasses - def external_security_solution_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionList - end - def rule - Azure::Security::Mgmt::V2015_06_01_preview::Models::Rule - end - def effective_network_security_groups - Azure::Security::Mgmt::V2015_06_01_preview::Models::EffectiveNetworkSecurityGroups - end def security_task_list Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskList end - def adaptive_network_hardenings_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardeningsList - end - def topology_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologyList - end - def adaptive_network_hardening_enforce_request - Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardeningEnforceRequest - end def security_task_parameters Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskParameters end - def topology_resource - Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologyResource - end - def topology_single_resource - Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResource - end - def connected_workspace - Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectedWorkspace - end - def connectable_resource - Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectableResource - end - def aad_solution_properties - Azure::Security::Mgmt::V2015_06_01_preview::Models::AadSolutionProperties - end - def allowed_connections_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::AllowedConnectionsList - end - def topology_single_resource_child - Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResourceChild - end - def app_whitelisting_issue_summary - Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingIssueSummary - end - def external_security_solution_kind1 - Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionKind1 - end - def publisher_info - Azure::Security::Mgmt::V2015_06_01_preview::Models::PublisherInfo - end - def external_security_solution_properties - Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionProperties - end - def path_recommendation - Azure::Security::Mgmt::V2015_06_01_preview::Models::PathRecommendation - end - def aad_connectivity_state1 - Azure::Security::Mgmt::V2015_06_01_preview::Models::AadConnectivityState1 - end - def app_whitelisting_groups - Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingGroups - end - def jit_network_access_port_rule - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPortRule - end - def discovered_security_solution - Azure::Security::Mgmt::V2015_06_01_preview::Models::DiscoveredSecuritySolution - end - def jit_network_access_policy_virtual_machine - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyVirtualMachine - end - def external_security_solution - Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolution - end - def jit_network_access_request_port - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequestPort - end - def jit_network_access_request_virtual_machine - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequestVirtualMachine - end - def topology_single_resource_parent - Azure::Security::Mgmt::V2015_06_01_preview::Models::TopologySingleResourceParent - end - def jit_network_access_request - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessRequest - end - def allowed_connections_resource - Azure::Security::Mgmt::V2015_06_01_preview::Models::AllowedConnectionsResource - end - def jit_network_access_policy - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicy - end - def vm_recommendation - Azure::Security::Mgmt::V2015_06_01_preview::Models::VmRecommendation - end - def jit_network_access_policies_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPoliciesList - end - def app_whitelisting_group - Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingGroup - end - def jit_network_access_policy_initiate_port - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiatePort - end - def discovered_security_solution_list - Azure::Security::Mgmt::V2015_06_01_preview::Models::DiscoveredSecuritySolutionList - end - def jit_network_access_policy_initiate_virtual_machine - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiateVirtualMachine - end - def jit_network_access_policy_initiate_request - Azure::Security::Mgmt::V2015_06_01_preview::Models::JitNetworkAccessPolicyInitiateRequest - end - def location - Azure::Security::Mgmt::V2015_06_01_preview::Models::Location - end - def kind - Azure::Security::Mgmt::V2015_06_01_preview::Models::Kind - end def app_whitelisting_put_group_data Azure::Security::Mgmt::V2015_06_01_preview::Models::AppWhitelistingPutGroupData end def asc_location_list Azure::Security::Mgmt::V2015_06_01_preview::Models::AscLocationList end - def connected_resource - Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectedResource - end def operation_display Azure::Security::Mgmt::V2015_06_01_preview::Models::OperationDisplay end def operation_list Azure::Security::Mgmt::V2015_06_01_preview::Models::OperationList end - def user_recommendation - Azure::Security::Mgmt::V2015_06_01_preview::Models::UserRecommendation - end def operation Azure::Security::Mgmt::V2015_06_01_preview::Models::Operation end - def adaptive_network_hardening - Azure::Security::Mgmt::V2015_06_01_preview::Models::AdaptiveNetworkHardening - end - def cef_solution_properties - Azure::Security::Mgmt::V2015_06_01_preview::Models::CefSolutionProperties - end - def cef_external_security_solution - Azure::Security::Mgmt::V2015_06_01_preview::Models::CefExternalSecuritySolution - end - def ata_solution_properties - Azure::Security::Mgmt::V2015_06_01_preview::Models::AtaSolutionProperties - end - def ata_external_security_solution - Azure::Security::Mgmt::V2015_06_01_preview::Models::AtaExternalSecuritySolution - end - def aad_external_security_solution - Azure::Security::Mgmt::V2015_06_01_preview::Models::AadExternalSecuritySolution - end def security_task Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityTask end - def direction - Azure::Security::Mgmt::V2015_06_01_preview::Models::Direction - end - def transport_protocol - Azure::Security::Mgmt::V2015_06_01_preview::Models::TransportProtocol - end - def security_family - Azure::Security::Mgmt::V2015_06_01_preview::Models::SecurityFamily - end - def aad_connectivity_state - Azure::Security::Mgmt::V2015_06_01_preview::Models::AadConnectivityState - end - def external_security_solution_kind - Azure::Security::Mgmt::V2015_06_01_preview::Models::ExternalSecuritySolutionKind - end - def protocol - Azure::Security::Mgmt::V2015_06_01_preview::Models::Protocol - end - def status - Azure::Security::Mgmt::V2015_06_01_preview::Models::Status - end - def status_reason - Azure::Security::Mgmt::V2015_06_01_preview::Models::StatusReason - end - def connection_type - Azure::Security::Mgmt::V2015_06_01_preview::Models::ConnectionType - end def information_protection_keyword Azure::Security::Mgmt::V2017_08_01_preview::Models::InformationProtectionKeyword end @@ -611,9 +479,6 @@ module Azure::Security::Profiles::Latest def regulatory_compliance_standard_list Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceStandardList end - def server_vulnerability_assessments_list - Azure::Security::Mgmt::V2019_01_01_preview::Models::ServerVulnerabilityAssessmentsList - end def regulatory_compliance_standard Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceStandard end @@ -623,9 +488,6 @@ module Azure::Security::Profiles::Latest def regulatory_compliance_assessment Azure::Security::Mgmt::V2019_01_01_preview::Models::RegulatoryComplianceAssessment end - def server_vulnerability_assessment - Azure::Security::Mgmt::V2019_01_01_preview::Models::ServerVulnerabilityAssessment - end def state Azure::Security::Mgmt::V2019_01_01_preview::Models::State end @@ -695,9 +557,6 @@ module Azure::Security::Profiles::Latest def io_tsecurity_solution_analytics_model_properties_devices_metrics_item Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem end - def resource - Azure::Security::Mgmt::V2019_08_01::Models::Resource - end def io_tsecurity_device_alerts_list Azure::Security::Mgmt::V2019_08_01::Models::IoTSecurityDeviceAlertsList end @@ -716,9 +575,6 @@ module Azure::Security::Profiles::Latest def io_tsecurity_solution_analytics_model Azure::Security::Mgmt::V2019_08_01::Models::IoTSecuritySolutionAnalyticsModel end - def asc_location - Azure::Security::Mgmt::V2019_08_01::Models::AscLocation - end def update_iot_security_solution_data Azure::Security::Mgmt::V2019_08_01::Models::UpdateIotSecuritySolutionData end @@ -740,6 +596,258 @@ module Azure::Security::Profiles::Latest def recommendation_config_status Azure::Security::Mgmt::V2019_08_01::Models::RecommendationConfigStatus end + def resource_details + Azure::Security::Mgmt::V2020_01_01::Models::ResourceDetails + end + def rule + Azure::Security::Mgmt::V2020_01_01::Models::Rule + end + def assessment_status + Azure::Security::Mgmt::V2020_01_01::Models::AssessmentStatus + end + def effective_network_security_groups + Azure::Security::Mgmt::V2020_01_01::Models::EffectiveNetworkSecurityGroups + end + def adaptive_network_hardenings_list + Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardeningsList + end + def jit_network_access_policy + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicy + end + def jit_network_access_policy_initiate_port + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiatePort + end + def assessment_links + Azure::Security::Mgmt::V2020_01_01::Models::AssessmentLinks + end + def location + Azure::Security::Mgmt::V2020_01_01::Models::Location + end + def security_assessment_partner_data + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentPartnerData + end + def etag + Azure::Security::Mgmt::V2020_01_01::Models::ETag + end + def topology_list + Azure::Security::Mgmt::V2020_01_01::Models::TopologyList + end + def resource + Azure::Security::Mgmt::V2020_01_01::Models::Resource + end + def security_assessment_list + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentList + end + def connected_resource + Azure::Security::Mgmt::V2020_01_01::Models::ConnectedResource + end + def topology_resource + Azure::Security::Mgmt::V2020_01_01::Models::TopologyResource + end + def allowed_connections_resource + Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsResource + end + def topology_single_resource + Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResource + end + def protection_mode + Azure::Security::Mgmt::V2020_01_01::Models::ProtectionMode + end + def discovered_security_solution + Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolution + end + def vm_recommendation + Azure::Security::Mgmt::V2020_01_01::Models::VmRecommendation + end + def discovered_security_solution_list + Azure::Security::Mgmt::V2020_01_01::Models::DiscoveredSecuritySolutionList + end + def user_recommendation + Azure::Security::Mgmt::V2020_01_01::Models::UserRecommendation + end + def external_security_solution + Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolution + end + def app_whitelisting_group + Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroup + end + def external_security_solution_list + Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionList + end + def security_assessment_metadata_partner_data + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataPartnerData + end + def topology_single_resource_child + Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResourceChild + end + def jit_network_access_policies_list + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPoliciesList + end + def topology_single_resource_parent + Azure::Security::Mgmt::V2020_01_01::Models::TopologySingleResourceParent + end + def adaptive_network_hardening_enforce_request + Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardeningEnforceRequest + end + def server_vulnerability_assessments_list + Azure::Security::Mgmt::V2020_01_01::Models::ServerVulnerabilityAssessmentsList + end + def kind + Azure::Security::Mgmt::V2020_01_01::Models::Kind + end + def jit_network_access_policy_initiate_request + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiateRequest + end + def connected_workspace + Azure::Security::Mgmt::V2020_01_01::Models::ConnectedWorkspace + end + def allowed_connections_list + Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList + end + def aad_solution_properties + Azure::Security::Mgmt::V2020_01_01::Models::AadSolutionProperties + end + def publisher_info + Azure::Security::Mgmt::V2020_01_01::Models::PublisherInfo + end + def jit_network_access_policy_initiate_virtual_machine + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyInitiateVirtualMachine + end + def app_whitelisting_groups + Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingGroups + end + def external_security_solution_kind1 + Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionKind1 + end + def security_assessment_metadata_list + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataList + end + def external_security_solution_properties + Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionProperties + end + def tags + Azure::Security::Mgmt::V2020_01_01::Models::Tags + end + def aad_connectivity_state1 + Azure::Security::Mgmt::V2020_01_01::Models::AadConnectivityState1 + end + def app_whitelisting_issue_summary + Azure::Security::Mgmt::V2020_01_01::Models::AppWhitelistingIssueSummary + end + def jit_network_access_port_rule + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPortRule + end + def security_assessment_metadata_properties + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadataProperties + end + def jit_network_access_policy_virtual_machine + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessPolicyVirtualMachine + end + def connectable_resource + Azure::Security::Mgmt::V2020_01_01::Models::ConnectableResource + end + def jit_network_access_request_port + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequestPort + end + def tracked_resource + Azure::Security::Mgmt::V2020_01_01::Models::TrackedResource + end + def jit_network_access_request_virtual_machine + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequestVirtualMachine + end + def path_recommendation + Azure::Security::Mgmt::V2020_01_01::Models::PathRecommendation + end + def jit_network_access_request + Azure::Security::Mgmt::V2020_01_01::Models::JitNetworkAccessRequest + end + def adaptive_network_hardening + Azure::Security::Mgmt::V2020_01_01::Models::AdaptiveNetworkHardening + end + def asc_location + Azure::Security::Mgmt::V2020_01_01::Models::AscLocation + end + def security_assessment_metadata + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessmentMetadata + end + def security_assessment + Azure::Security::Mgmt::V2020_01_01::Models::SecurityAssessment + end + def on_premise_resource_details + Azure::Security::Mgmt::V2020_01_01::Models::OnPremiseResourceDetails + end + def azure_resource_details + Azure::Security::Mgmt::V2020_01_01::Models::AzureResourceDetails + end + def cef_solution_properties + Azure::Security::Mgmt::V2020_01_01::Models::CefSolutionProperties + end + def cef_external_security_solution + Azure::Security::Mgmt::V2020_01_01::Models::CefExternalSecuritySolution + end + def ata_solution_properties + Azure::Security::Mgmt::V2020_01_01::Models::AtaSolutionProperties + end + def ata_external_security_solution + Azure::Security::Mgmt::V2020_01_01::Models::AtaExternalSecuritySolution + end + def aad_external_security_solution + Azure::Security::Mgmt::V2020_01_01::Models::AadExternalSecuritySolution + end + def server_vulnerability_assessment + Azure::Security::Mgmt::V2020_01_01::Models::ServerVulnerabilityAssessment + end + def direction + Azure::Security::Mgmt::V2020_01_01::Models::Direction + end + def transport_protocol + Azure::Security::Mgmt::V2020_01_01::Models::TransportProtocol + end + def category + Azure::Security::Mgmt::V2020_01_01::Models::Category + end + def severity + Azure::Security::Mgmt::V2020_01_01::Models::Severity + end + def user_impact + Azure::Security::Mgmt::V2020_01_01::Models::UserImpact + end + def implementation_effort + Azure::Security::Mgmt::V2020_01_01::Models::ImplementationEffort + end + def threats + Azure::Security::Mgmt::V2020_01_01::Models::Threats + end + def assessment_type + Azure::Security::Mgmt::V2020_01_01::Models::AssessmentType + end + def assessment_status_code + Azure::Security::Mgmt::V2020_01_01::Models::AssessmentStatusCode + end + def security_family + Azure::Security::Mgmt::V2020_01_01::Models::SecurityFamily + end + def aad_connectivity_state + Azure::Security::Mgmt::V2020_01_01::Models::AadConnectivityState + end + def external_security_solution_kind + Azure::Security::Mgmt::V2020_01_01::Models::ExternalSecuritySolutionKind + end + def protocol + Azure::Security::Mgmt::V2020_01_01::Models::Protocol + end + def status + Azure::Security::Mgmt::V2020_01_01::Models::Status + end + def status_reason + Azure::Security::Mgmt::V2020_01_01::Models::StatusReason + end + def connection_type + Azure::Security::Mgmt::V2020_01_01::Models::ConnectionType + end + def expand_enum + Azure::Security::Mgmt::V2020_01_01::Models::ExpandEnum + end end end end diff --git a/management/azure_mgmt_security/lib/version.rb b/management/azure_mgmt_security/lib/version.rb index 0eafb4200..49678b2f2 100644 --- a/management/azure_mgmt_security/lib/version.rb +++ b/management/azure_mgmt_security/lib/version.rb @@ -3,5 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. module Azure::Security::Mgmt - VERSION = '0.18.1' + VERSION = '0.18.2' end